Brian from Maui
MrExcel MVP
- Joined
- Feb 16, 2002
- Messages
- 8,459
Aloha,
I recorded the following macro and would like to extend the macro to row 1,000. The macro inserts a row, deletes column C, then cuts cells A5 and B5 and paste the cells in F2 and G2. It then deletes 8 rows.
Then it repeats the process
Thanks
I recorded the following macro and would like to extend the macro to row 1,000. The macro inserts a row, deletes column C, then cuts cells A5 and B5 and paste the cells in F2 and G2. It then deletes 8 rows.
Then it repeats the process
Thanks
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Range("A5:B5").Select
Selection.Cut
Range("F2").Select
ActiveSheet.Paste
Rows("3:10").Select
Selection.Delete Shift:=xlUp
Range("A6:B6").Select
Selection.Cut
Range("F3").Select
ActiveSheet.Paste
Rows("4:11").Select
Selection.Delete Shift:=xlUp
Range("A7:B7").Select
Selection.Cut
Range("F4").Select
ActiveSheet.Paste
Rows("5:12").Select
Selection.Delete Shift:=xlUp
Range("A8:B8").Select
Selection.Cut
Range("F5").Select
ActiveSheet.Paste
Rows("6:13").Select
Selection.Delete Shift:=xlUp
Range("A9:B9").Select
Selection.Cut
Range("F6").Select
ActiveSheet.Paste
Rows("7:14").Select
Selection.Delete Shift:=xlUp
Range("A10:B10").Select
Selection.Cut
Range("F7").Select
ActiveSheet.Paste
Rows("8:15").Select
Selection.Delete Shift:=xlUp
Range("A11:B11").Select
Selection.Cut
Range("F8").Select
ActiveSheet.Paste
Rows("9:16").Select
Selection.Delete Shift:=xlUp
Range("A12:B12").Select
Selection.Cut
Range("F9").Select
ActiveSheet.Paste
End Sub