turk1077
New Member
- Joined
- Dec 27, 2004
- Messages
- 47
Hello all power users!
I am trying to write a little VBA the prompts the user for the number of rows to insert then inserts that number of rows at active cell. Here is the code I've got, but it doesn't work. I'm just getting started with VBA and I think there must be something fundamental that I am missing...
I am trying to write a little VBA the prompts the user for the number of rows to insert then inserts that number of rows at active cell. Here is the code I've got, but it doesn't work. I'm just getting started with VBA and I think there must be something fundamental that I am missing...
Code:
Sub InsertRows()
Dim numrows As Integer
numrows = InputBox("Number of Rows")
ActiveCell.Rows("1:'numrows'").EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Select
End Sub