Hi, I am trying to create a spreadsheet for a client of ours and the point is to make it easier for them to access their information in the spreadsheet. They want a button to the right of their spreadsheet, which I have already created, but I need a code to where it automatically adds a new row when they click on this button. I did research and found a posting on here from awhile ago that was exactly what I needed I believe but I can't get it to work for my Excel spreadsheet.
This is the code I found: I need this code to be where I can click it and it adds an entire row above row number 11. Can someone help me with this??
Sub AddARow()
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
Thank you!!
This is the code I found: I need this code to be where I can click it and it adds an entire row above row number 11. Can someone help me with this??
Sub AddARow()
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
Thank you!!