Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
Relative references gcotterl Excel Worksheet Functions 4 June 17th 06 05:23 AM
Relative references GARY Excel Discussion (Misc queries) 7 June 16th 06 10:08 PM
macro vba relative references aut1jlt Excel Worksheet Functions 0 April 20th 05 06:13 PM


All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"