Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The following macro works - how can I make it so thate the numbers can be
variable. Sub test3() shtGPA9D.Rows("195:198").Insert End Sub I would like to have something like the following Sub test3() dim r as integer r = 195 shtGPA9D.Rows(r:r+3).Insert End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Why does this work with "r" defined as long and not with integer?
Sub test3() Dim r As Long r = 195 shtGPA9D.Rows(r & ":" & r + 3).Insert End Sub "Brad" wrote: The following macro works - how can I make it so thate the numbers can be variable. Sub test3() shtGPA9D.Rows("195:198").Insert End Sub I would like to have something like the following Sub test3() dim r as integer r = 195 shtGPA9D.Rows(r:r+3).Insert End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It works for me whether 'r' is defined as Long or Integer.
Rick "Brad" wrote in message ... Why does this work with "r" defined as long and not with integer? Sub test3() Dim r As Long r = 195 shtGPA9D.Rows(r & ":" & r + 3).Insert End Sub "Brad" wrote: The following macro works - how can I make it so thate the numbers can be variable. Sub test3() shtGPA9D.Rows("195:198").Insert End Sub I would like to have something like the following Sub test3() dim r as integer r = 195 shtGPA9D.Rows(r:r+3).Insert End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The initial code posted Did not have the colon in Quotes. That's the
difference... -- HTH... Jim Thomlinson "Brad" wrote: Why does this work with "r" defined as long and not with integer? Sub test3() Dim r As Long r = 195 shtGPA9D.Rows(r & ":" & r + 3).Insert End Sub "Brad" wrote: The following macro works - how can I make it so thate the numbers can be variable. Sub test3() shtGPA9D.Rows("195:198").Insert End Sub I would like to have something like the following Sub test3() dim r as integer r = 195 shtGPA9D.Rows(r:r+3).Insert End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to make a Chart with a Variable Data Window | Excel Discussion (Misc queries) | |||
Can I make array position A(12) into a variable A(12*n) ? | Excel Worksheet Functions | |||
Variable Macro | Excel Discussion (Misc queries) | |||
how do I make single character as a variable in an array | Excel Worksheet Functions | |||
make a vlookup using a variable path | Excel Worksheet Functions |