Rows to Columns

bobbabuoy

New Member
Joined
Feb 26, 2004
Messages
15
I have an excel sheet with about 2500 rows that is set up so that related information are in 'groups' of 3. For instance, a1, a2, and a3 are related, as are a4, a5, and a6. I want to split these groups up into columns. For instance, I want to move a2 to b1 and a3 to c1. Then I want to move a4 to a2, a5 to b2, and a6 to c2, etc.

I have one idea and that is to copy the data as it exists now to columns b and c, delete the first item in b and the first two items in c and then go through and delete every 2nd/3rd rows. Is there a better way?

Thanks!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

ken2step

Well-known Member
Joined
Jan 9, 2003
Messages
638
I think this might be what you want....

Insert/worksheet

In Cell A1 of new sheet enter =Sheet1!A1
In Cell B1 of new sheet enter =Sheet1!A2
In Cell C1 of new sheet enter =Sheet1!A3

In Cell A2 of new sheet enter =INDIRECT("Sheet1!"&(ADDRESS(A1+3,1,4)))

Fill this formula across B2 and C2, then down as far as needed.

Ken
 

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,518
Hi

Welcome to the board.

Here's a macro solution which places the data in columns B,c & D.

Code:
Sub Group3()
Dim R As Range
Dim lRowEnd As Long
Dim lRowA As Long
Dim lRowBCD
Dim lCol As Long

lRowEnd = Range("A65536").End(xlUp).Row
lRowBCD = 0
lCol = 4
For Each R In Range("A1:A" & lRowEnd)
    If lCol > 3 Then
        lCol = 2
        lRowBCD = lRowBCD + 1
    Else
        lCol = lCol + 1
    End If
    Cells(lRowBCD, lCol).Value = R.Value
Next R
End Sub

HTH

Alan
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,323
Messages
5,769,454
Members
425,549
Latest member
Bartekelese

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top