Moving cells

SeanK137

New Member
Joined
Sep 16, 2008
Messages
43
All, tried to search around but didn't see anything similar to my issue.

I have an excel sheet that has all of its information in grouped in column a that should be organized in a different manner. Every 6 cells contains a group of information, which I would like to separate. For example, there is information in a1:a6. A1 should stay in a1, A2 --> B1, A3 --> C1, A4 --> D1, A5 --> E1 and A6 --> F1. I need the macro to keep going through the rest of the sheet placing the information in a2, b2, c2, etc where appropriate until all of the information is dispersed. Any suggestions?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
select the data in column A (not the whole column, only those with data) do a copy / paste special, click transpose
 
Upvote 0
Hello,

does this work as expected?

Code:
Sub TRANSPOSE()
    For MY_ROWS = 1 To Range("A" & Rows.Count).End(xlUp).Row Step 6
        Range("A" & MY_ROWS & ":A" & MY_ROWS + 5).Copy
        Range("B65536").End(xlUp).Offset(1, 0).Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, TRANSPOSE:=True
    Next MY_ROWS
    Columns(1).Delete
    Rows(1).Delete
End Sub
 
Upvote 0
Very Cool! I had no idea there was a function for that.

How would I write a macro that takes each group of 6 cells and transposes them?
 
Upvote 0
Very Cool! I had no idea there was a function for that.

How would I write a macro that takes each group of 6 cells and transposes them?
I believe the above code by onlyadrafter does that (Not tested), but this also will
Code:
Sub Transpose()
Dim i, j, k As Integer
j = 6
k = 1
For i = 1 To 1000 Step 6
If Cells(i, 1) = "" Then Exit Sub
Range(Cells(i, 1), Cells(j, 1)).Copy
Cells(k, 2).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
j = j + 6
k = k + 1
Next i
End Sub

lenze
 
Upvote 0

Forum statistics

Threads
1,202,977
Messages
6,052,891
Members
444,609
Latest member
Fritz23

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