Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Find print area when no print area set

I have a worksheet that is shown in page break preview view.

The heavy blue outline shows the boundary of what is shown in a print preview.

There is no print area set. I would like a macro that would find the address
of this blue boundary and set it to the print area.

How can this be done?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Find print area when no print area set

Range("A1").SpecialCells(xlLastCell).address will give you the bottom right
cell used.
--
JNW


"mcphc" wrote:

I have a worksheet that is shown in page break preview view.

The heavy blue outline shows the boundary of what is shown in a print preview.

There is no print area set. I would like a macro that would find the address
of this blue boundary and set it to the print area.

How can this be done?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Find print area when no print area set

Found it!

ActiveSheet.PageSetup.PrintArea = ActiveSheet.UsedRange.Address

So simple!

"mcphc" wrote:

I have a worksheet that is shown in page break preview view.

The heavy blue outline shows the boundary of what is shown in a print preview.

There is no print area set. I would like a macro that would find the address
of this blue boundary and set it to the print area.

How can this be done?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Find print area when no print area set

Thanks that is easy!
--
JNW


"mcphc" wrote:

Found it!

ActiveSheet.PageSetup.PrintArea = ActiveSheet.UsedRange.Address

So simple!

"mcphc" wrote:

I have a worksheet that is shown in page break preview view.

The heavy blue outline shows the boundary of what is shown in a print preview.

There is no print area set. I would like a macro that would find the address
of this blue boundary and set it to the print area.

How can this be done?

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
set area in excel not giving me option to set print area? J Littlebear Excel Discussion (Misc queries) 4 April 23rd 23 09:04 PM
File, print area, clear area, is not working cblind New Users to Excel 2 September 12th 07 04:51 PM
Macro - Set Print Area for Changing Data Area ksp Excel Programming 5 May 15th 06 10:20 PM
Find print area enginguven Excel Discussion (Misc queries) 1 January 12th 06 01:54 AM
How do you turn off a print area for a page? (no print area) Grunen Excel Discussion (Misc queries) 4 October 8th 05 07:46 PM


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

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

About Us

"It's about Microsoft Excel"