I need to insert a number of rows into a worksheet. I cannot copy and paste as thier is information on the worksheet that cannot be removed. The number changes on each worksheet and Id prefer not to use Named Ranges because of this. The code below works but i would like to take the number 5 (in this instance) from a cell (J4).
Tried multiple ways but cant seem to do, what im guessing is a pretty basic thing
Thanks in advance for any help
Sub InsertRows()
Dim RowNum As Integer
Dim InsertNum As Integer
InsertNum = 5
RowNum = 1
Do While RowNum <= InsertNum
Rows("7:7").Select
Selection.Insert Shift:=xlDown
RowNum = RowNum + 1
Loop
End Sub
Tried multiple ways but cant seem to do, what im guessing is a pretty basic thing
Thanks in advance for any help
Sub InsertRows()
Dim RowNum As Integer
Dim InsertNum As Integer
InsertNum = 5
RowNum = 1
Do While RowNum <= InsertNum
Rows("7:7").Select
Selection.Insert Shift:=xlDown
RowNum = RowNum + 1
Loop
End Sub