Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
Im trying to record a macro using the relative reference option in order to
change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
A snippet of your code would be helpful.
-- John C "warp9" wrote: Im trying to record a macro using the relative reference option in order to change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
Thanks John.
ActiveCell.Offset(3, 0).Range("A1:M100").Select ActiveSheet.PageSetup.PrintArea = "$A$701:$M$800" "John C" wrote: A snippet of your code would be helpful. -- John C "warp9" wrote: Im trying to record a macro using the relative reference option in order to change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
Your code is selecting A1:M100, but then printing A701:M800 only.
Change your second line to this: ActiveSheet.PageSetup.PrintArea = Selection.Address Hope this helps. -- John C "warp9" wrote: Thanks John. ActiveCell.Offset(3, 0).Range("A1:M100").Select ActiveSheet.PageSetup.PrintArea = "$A$701:$M$800" "John C" wrote: A snippet of your code would be helpful. -- John C "warp9" wrote: Im trying to record a macro using the relative reference option in order to change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
Awesome John. Thanks! I tried it several times and it works perfectly.
"John C" wrote: Your code is selecting A1:M100, but then printing A701:M800 only. Change your second line to this: ActiveSheet.PageSetup.PrintArea = Selection.Address Hope this helps. -- John C "warp9" wrote: Thanks John. ActiveCell.Offset(3, 0).Range("A1:M100").Select ActiveSheet.PageSetup.PrintArea = "$A$701:$M$800" "John C" wrote: A snippet of your code would be helpful. -- John C "warp9" wrote: Im trying to record a macro using the relative reference option in order to change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro using relative references
Thanks for the feedback :)
-- John C "warp9" wrote: Awesome John. Thanks! I tried it several times and it works perfectly. "John C" wrote: Your code is selecting A1:M100, but then printing A701:M800 only. Change your second line to this: ActiveSheet.PageSetup.PrintArea = Selection.Address Hope this helps. -- John C "warp9" wrote: Thanks John. ActiveCell.Offset(3, 0).Range("A1:M100").Select ActiveSheet.PageSetup.PrintArea = "$A$701:$M$800" "John C" wrote: A snippet of your code would be helpful. -- John C "warp9" wrote: Im trying to record a macro using the relative reference option in order to change the print area every time its run. The active cell offset reference appears in the code, yet the print range defaults to the original print area regardless of where the cursor is placed when the macro is run. What am I doing wrong? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert relative cell references to absolute cell references via amacro? | Excel Discussion (Misc queries) | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
Relative references | Excel Worksheet Functions | |||
Relative references | Excel Discussion (Misc queries) | |||
macro vba relative references | Excel Worksheet Functions |