I need a loop to move many columns (in pairs) into 4 columns. I have row descriptions in column E:F and the values in I:J. The values can go out to columns GY:GZ. I need to move columns E:F to A:B and the number values to C:D. So all data will be moved to columns A-B-C-D. Here is the code I have. I added the separation lines to make it easier to see what's going on.
The code is written for each column that has data to be moved. This makes the module extremely long and cumbersome. Does anyone know how to loop this function? Thanks.
Code:
Range("E2:F2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
'------------------------
Range("I2:J2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("C2").Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
'-------------------------
Range("E2:F2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
'-------------------------
Range("K2:L2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("C2").Select
Selection.End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
Last edited: