Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jerry B
 
Posts: n/a
Default How to Dynamically Set Print Area

I have filtered the number of rows and copied them to a separate area of the
worksheet. The number of rows after the filter is unknown. How do I change
the Print Area range of rows to be the number of rows after the filter
(otherwise I will print pages and pages of paper)

Thanks,
--
Jerry B
  #2   Report Post  
Tom Ogilvy
 
Posts: n/a
Default

Select the area you want printed, then do File=PrintArea = Set Print Area

programmatically

set rng = Range("AB50").CurrentRegion
activesheet.pageSetup.Printarea = rng.Address(external:=True)

Change AB50 to the cell that forms the top left corner of the data you want
to print.

--
Regards,
Tom Ogilvy

"Jerry B" wrote in message
...
I have filtered the number of rows and copied them to a separate area of

the
worksheet. The number of rows after the filter is unknown. How do I

change
the Print Area range of rows to be the number of rows after the filter
(otherwise I will print pages and pages of paper)

Thanks,
--
Jerry B



  #3   Report Post  
Jerry B
 
Posts: n/a
Default

Hi Tom: Thankyou for the reply. You have given me some ideas. I should
have said this is intended to be part of a macro to filter and then print.
The first row always is "copied" to A200 to T200 but the last cell to be
printed is determined by the advance filter operation and is T200+number of
filtered rows. I am thinking of leaving a marker in the last row and then
matching to determine the row number xxx and then setting the print area to
A200:Txxx in the macro if there is no easier way. Thanks again for your help.

"Jerry B" wrote:

I have filtered the number of rows and copied them to a separate area of the
worksheet. The number of rows after the filter is unknown. How do I change
the Print Area range of rows to be the number of rows after the filter
(otherwise I will print pages and pages of paper)

Thanks,
--
Jerry B

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
Printing - Have to set print area 1 column further than necessary STUART BISSET Excel Discussion (Misc queries) 0 January 24th 05 07:59 PM
Changing print area Aaron Excel Discussion (Misc queries) 2 January 9th 05 05:58 PM
How do I only show print area in excel? Jeffro Excel Discussion (Misc queries) 5 January 7th 05 02:08 AM
In Excel print area setup problem with 2 different computers with. Rafi Setting up and Configuration of Excel 1 December 22nd 04 10:44 AM
print a specific area within a worksheet by clicking on print? honclub Excel Worksheet Functions 1 October 29th 04 03:22 AM


All times are GMT +1. The time now is 06:31 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"