Hi all, I am currently working on a mini excel project where I need to add a new numbered row (i.e 2 to 3 to 4) but with my new rows having cleared contents.
My code right now is the following and I can' t remember how to add the number row. Any help is greatly appreciated. Thank you.
Private Sub CommandButton1_Click()
Dim varUserInput As Variant
varUserInput = InputBox("Enter Row Number where you want to add a row:", _
"What Row?")
If varUserInput = "" Then Exit Sub
RowNum = varUserInput
Rows(RowNum & ":" & RowNum).Insert Shift:=xlDown
Rows(RowNum - 1 & ":" & RowNum - 1).Copy Range("A" & RowNum)
Range(RowNum & ":" & RowNum).ClearContents
End Sub
Bookmarks