Hi, I have this macro that where I need to move data from across the sheet to the end of the data in column A.
The row mark ** is where it is falling down.
After the 'Selection.Delete Shift:=xlToLeft' I need to loop the copy ans paste 16 times. As I'm not a macro expert I'll probably repeat the code 16 times, but if anyone has a better idea?
Sub Format_csv()
'
' Format_csv Macro
'
'
Columns("A:A").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("A:A").Select
Selection.Copy
Columns("E:E").Select
ActiveSheet.Paste
Rows("1:1").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Range("E1:F1").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
Range("A1").Select
Range("E2:H2").Select
**Range("A" & Rows.Count).End(xlUp).Offset(1, 0)**
ActiveSheet.Paste
Columns("F:H").Select
Range("F22").Activate
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("E29").Select
Selection.End(xlUp).Select
Range("A1").Select
End If
End Sub
The row mark ** is where it is falling down.
After the 'Selection.Delete Shift:=xlToLeft' I need to loop the copy ans paste 16 times. As I'm not a macro expert I'll probably repeat the code 16 times, but if anyone has a better idea?
Sub Format_csv()
'
' Format_csv Macro
'
'
Columns("A:A").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("A:A").Select
Selection.Copy
Columns("E:E").Select
ActiveSheet.Paste
Rows("1:1").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Range("E1:F1").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
Range("A1").Select
Range("E2:H2").Select
**Range("A" & Rows.Count).End(xlUp).Offset(1, 0)**
ActiveSheet.Paste
Columns("F:H").Select
Range("F22").Activate
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("E29").Select
Selection.End(xlUp).Select
Range("A1").Select
End If
End Sub