Hello
Im trying to get my code to move to the next line when the command button is clicked. But the problem is, the code inserting a row everytime not just moving to the next row. I know its a problem with 'Entire Row.Insert' but what syntax do I replace it with to just move to the next row and not insert a row?
Im trying to get my code to move to the next line when the command button is clicked. But the problem is, the code inserting a row everytime not just moving to the next row. I know its a problem with 'Entire Row.Insert' but what syntax do I replace it with to just move to the next row and not insert a row?
Code:
Private Sub COMMANDBUTTON1_CLICK()
ActiveCell.Offset(Selection.Rows.Count, 0).EntireRow.Insert
Rows(ActiveCell.Row).Offset(Selection.Rows.Count - 1, 0).Copy
Range("A" & ActiveCell.Offset(Selection.Rows.Count, 0).Row).PasteSpecial (xlPasteFormats)
Range("A" & ActiveCell.Row).Value = Range("A" & ActiveCell.Offset(-1, 0).Row).Value + 1
Application.CutCopyMode = True
End Sub