Variable in Range

A

aftamath

This is my code:

Sub Macro1()

Dim intRow As Integer
intRow = InputBox(Prompt:="Enter Age", Title:="Age")

Application.Worksheets("Mold Flg Thk").Rows("10:19").Insert

End Sub

I would like to use the intRow variable in the .Rows range. But,

Application.Worksheets("Mold Flg Thk").Rows("10:intRow").Insert

doesn't work and neither do a few other variations.

Can the range be defined using the intRow variable?
 
T

Trevor Shuttleworth

Try:

Application.Worksheets("Mold Flg Thk").Rows("10:" & intRow).Insert

Regards

Trevor
 
Top