Hello, I have this Macro and I need it to repeat until there are no more lines. the tricky part is that the macro creates 6 new rows each time. also how can I make it delete the rows with zero balance?
thank you
Sub Create_Rows()
'
' Create_Rows Macro
'
' Keyboard Shortcut: Ctrl+q
'
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(-1, 0).Range("A1:C1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1:C6").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 3).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "7701.1"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "9010"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7620"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(-6, 0).Range("A1").Select
Selection.Cut
ActiveCell.Offset(1, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.Cut
ActiveCell.Offset(2, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-2, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(3, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-3, 2).Range("A1").Select
Selection.Cut
ActiveCell.Offset(4, -2).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-4, 3).Range("A1").Select
Selection.Cut
ActiveCell.Offset(5, -3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-5, 4).Range("A1").Select
Selection.Cut
ActiveCell.Offset(6, -4).Range("A1").Select
ActiveSheet.Paste
End Sub
thank you
Sub Create_Rows()
'
' Create_Rows Macro
'
' Keyboard Shortcut: Ctrl+q
'
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(-1, 0).Range("A1:C1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1:C6").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 3).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "7701.1"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "9010"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7620"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "7600"
ActiveCell.Offset(-6, 0).Range("A1").Select
Selection.Cut
ActiveCell.Offset(1, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.Cut
ActiveCell.Offset(2, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-2, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(3, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-3, 2).Range("A1").Select
Selection.Cut
ActiveCell.Offset(4, -2).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-4, 3).Range("A1").Select
Selection.Cut
ActiveCell.Offset(5, -3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-5, 4).Range("A1").Select
Selection.Cut
ActiveCell.Offset(6, -4).Range("A1").Select
ActiveSheet.Paste
End Sub