I have data in the first column of a sheet:
A
B
C
D
etc.
I now need to create rows with 2 columns where the first row has A B, the second row C D, etc.
It needs to do this until no data is available anymore.
Any pointers? Thanks in advance!
I have data in the first column of a sheet:
A
B
C
D
etc.
I now need to create rows with 2 columns where the first row has A B, the second row C D, etc.
It needs to do this until no data is available anymore.
Any pointers? Thanks in advance!
Use this code -![]()
Option Explicit Dim lrow As Long Dim i As Long Dim j As Long Sub make_cols() lrow = Range("A" & Rows.Count).End(xlUp).Row j = 1 For i = 1 To lrow Range("B" & j).Value = Range("A" & i).Value Range("C" & j).Value = Range("A" & i + 1).Value j = j + 1 i = i + 1 Next i End Sub
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Alternatively, if you don't want to use macros, you could use the following formula in Cells B1 & C1 (assuming your lists starts in A1):
Cheers, Rob.![]()
CELL B1 =OFFSET($A$1,ROW(A1)*2-ROW($A$1)*2,0) CELL C1 =OFFSET($A$1,ROW(A1)*2-ROW($A$1)*2+1,0)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks