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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

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
Back
Top