Sweedler
Board Regular
- Joined
- Nov 13, 2020
- Messages
- 114
- Office Version
- 2016
- Platform
- Windows
- MacOS
Ok, SO I have been working on this MACRO that would allow me to enter a variable number of rows into my spreadsheet from a variable point. Excel is telling me that I am mucking up in the last step with the "ROWS(..." line. I just can't really figure out why it wont work and would love some help solving this one.
Sub InsertROWS()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Application.InputBox("how many rows do you wish to add", "ADDING ROWS", Type:=1)
b = Application.InputBox("Starting from what row", "STARTING POINT", Type:=1)
c = ((a - 1) + b)
Range("e2").Value = a
Range("e3").Value = c
Rows("a:c").Value.EntireRow.Insert
End Sub
Sub InsertROWS()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Application.InputBox("how many rows do you wish to add", "ADDING ROWS", Type:=1)
b = Application.InputBox("Starting from what row", "STARTING POINT", Type:=1)
c = ((a - 1) + b)
Range("e2").Value = a
Range("e3").Value = c
Rows("a:c").Value.EntireRow.Insert
End Sub