Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to do the equivalent of this code, but variable:
Rows("546:546").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove (as provided by a Macro) However, I do not want to insert the row, everytime, at row 546. I want this number to be variable... equal to the row at Range(cell_range.Offset(cell_count + 2)) This range would correspond to "$A$546" at the default cell_count. However, this number, cell_count, will change and I want the row to always be in the correct location. So, I figured I could modify the macro code slightly, and used this: Rows(cell_range.Offset(cell_count + 2, 0)).Insert _ Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove However, it did not work. I figure it is because I am saying: Rows("$A$546").Insert How do I use variables to create something equivalent to Rows("546:546")? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using a variable to point to a location | Excel Worksheet Functions | |||
Insert new Worksheet with name, and insert the sheet into itsalphabetical / numerical location | Excel Programming | |||
Set a range from a variable location | Excel Discussion (Misc queries) | |||
VBA - Passing Cell Location To Variable | Excel Programming | |||
using variable as cell location | Excel Programming |