Good afternoon. I am trying to write a macro that will take grouped data in columns A&B, C&D, E&F, G&H, ... and paste it one under the other in a new workbook. The data consists of Product Number and Inventory. An example of the data:
Product Inventory Product Inventory Product Inventory
A12314 112 A5588 11 B5587 10
B1158 0 C55478 100 D5587 5
I want to transpose the data onto a new workbook so I see:
Product Inventory
A12314 112
B1158 0
A5588 11
C55478 100
B5587 10
D5587 5
Current vba copies data to new worksheet, but stacks Col A,B,C,D,E,F... in same column.
Sub SortandGroupData()
Application.ScreenUpdating = 0
Dim LC&, i&, ms As Worksheet, j&
Set ms = Sheets("Test2")
j = ms.Range("IV2").End(xlToLeft).Column 'Finds last column
With Sheets("Test")
LC = .Cells.Find("*", , , , xlByColumns, xlPrevious).Column
For i = 1 To LC
'.Cells(2,i) will remove the top row (title row)
.Cells(2, i).Resize(.Cells(.Rows.Count, i).End(xlUp).Row).Copy
ms.Cells(Rows.Count, j).End(xlUp).Offset(0).PasteSpecial xlValues
Next i
End With
Application.CutCopyMode = 0
Application.ScreenUpdating = True
End Sub
I appreciate any and all help.
Regards,
Marc
Bookmarks