Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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? |
#2
![]() |
|||
|
|||
![]()
Application.Worksheets("Mold Flg Thk").Rows("10:" & introw).Insert
aftamath wrote: 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? -- Dave Peterson |
#3
![]() |
|||
|
|||
![]()
Try:
Application.Worksheets("Mold Flg Thk").Rows("10:" & intRow).Insert Regards Trevor "aftamath" wrote in message ... 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
Match function...random search? | Excel Worksheet Functions | |||
How to use a variable for a range | Excel Worksheet Functions | |||
Is it possible to set a variable range in a macro? | About this forum | |||
Set Data Range by Variable | Excel Discussion (Misc queries) |