Maverick21
07-05-2016, 02:06 PM
Newb here. I'm trying to create a template that will add a number of rows above row 20 based on a value input by the user in cell E5. So far I have this which will be built on to but i need this part to work first. The +18 piece is just to make it select the right row given the input in E5.
For example, User inputs the number of units he wants an ROI for, and the spreadsheet adds the appropriate number of rows to this range.
Sub Add_Rows()
'
' Add_Rows Macro
'
Application.ScreenUpdating = False
Dim intRowInsert As Integer
intRowInsert = Range("E5").Value + 18
Rows("20:inRowInsert").Insert
End Sub
For example, User inputs the number of units he wants an ROI for, and the spreadsheet adds the appropriate number of rows to this range.
Sub Add_Rows()
'
' Add_Rows Macro
'
Application.ScreenUpdating = False
Dim intRowInsert As Integer
intRowInsert = Range("E5").Value + 18
Rows("20:inRowInsert").Insert
End Sub