Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Print Area Macro Question

I'm using a macro worksheet change macro, so that when ever someone changes a
pivottable the sheet will automatically change the print area of the pivot
table. I'm trying the following code, but everytime I try and record I get a
fixed value as you see here. How can I get the print area to use the range I
selected above?

Range("E10").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$E$10:$P$32"

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Print Area Macro Question

Change last statement to:
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Vick" wrote in message
...
I'm using a macro worksheet change macro, so that when ever someone
changes a
pivottable the sheet will automatically change the print area of the pivot
table. I'm trying the following code, but everytime I try and record I get
a
fixed value as you see here. How can I get the print area to use the range
I
selected above?

Range("E10").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$E$10:$P$32"

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Print Area Macro Question

But this seems to be OK
ActiveSheet.PageSetup.PrintArea = ActiveWindow.RangeSelection.Address
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Vick" wrote in message
...
I'm using a macro worksheet change macro, so that when ever someone
changes a
pivottable the sheet will automatically change the print area of the pivot
table. I'm trying the following code, but everytime I try and record I get
a
fixed value as you see here. How can I get the print area to use the range
I
selected above?

Range("E10").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$E$10:$P$32"

Thanks



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
Another Print Area question curiosity_killed_the_cat[_2_] Excel Discussion (Misc queries) 3 January 29th 08 09:35 PM
setting the print area from a macro Joe Farruggio Excel Worksheet Functions 10 November 25th 06 01:10 AM
How do you set up a macro to reset the print area? Stuck2 Excel Discussion (Misc queries) 0 January 30th 06 03:50 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM


All times are GMT +1. The time now is 03:00 AM.

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"