Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Page Break while sizing to fit page

I would like to add a page break statement into my macro, but I would
also like the pages, once the page break has been defined, to expand
to fill the available space on the paper. There is no easy way to
know in advance how wide the data columns will be (they adjust
depending on the data entered). I guess I could calculate the total
width and force the page width using a statement like this and then
manually define the page width and not use the 'Fit to Page' option,
but it seems like a memory-intensive brute force way to do it. I
think I could do it as follows to measure the column width and then
somehow use that info to set the page size, but it just does not seem
like a good way to do it. Perhaps it is the only way, though.

Totalwidth = Range("D2:CD2").Width
Range("B247").Formula = Totalwidth

Right now I have tried to define the pages as 2 pages wide as below,
but when I add the page break point and add in the 'Fit to page" it no
longer works. The Fit To Page command it seems to over-ride the page
breaks, even if I add the statements -

With ActiveSheet.PageSetup
.FitToPagesWide = 2
.FitToPagesTall = 1

Is there any way to do this? Once again, I really appreciate the help.

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
Excel 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
change and/or remove page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:15 AM
Hiding the page number in page break preview background. I need coffee, wake me up! Excel Discussion (Misc queries) 0 May 15th 06 10:32 AM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM


All times are GMT +1. The time now is 12:44 PM.

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"