LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Tips for optimising page setup .Zoom and .FitTo properties

"Paul Robinson" wrote
Should be adaptable though?


Paul,

Have found a small bug in your function that you might like review.

It relates the ActiveSheet.UsedRange.Width property returning the number of
Points to the top left of the last cell in the range - ie. it does not
include the width of this last column (or height of the last row). The
mod'ed code now looks like ....

' Get the visible range in points - ensuring it rounds up
With ActiveSheet.UsedRange
lngUsedWidth = CLng(.Width + .Columns(.Columns.Count).Width + 1#)
lngUsedHeight = CLng(.Height + .Rows(.Rows.Count).Height + 1#)
End With

I suspect this will work even if the last column or row is hidden because
Excel reports the Width or Height of such columns/rows as 0 points.

As Agent 86 would have said its the "old top left corner mentality yet
again"! Not a very intuitive arrangement although it is consistent - and
too late to change Excel now.

Regards,
Frank.


 
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
No zoom to page option ??? Blue Max New Users to Excel 5 April 11th 10 03:19 AM
Page layout - page setup - items disabled Bill D - Hubbard & Co Excel Discussion (Misc queries) 6 February 2nd 10 04:34 PM
FORMAT EXCEL WORKBOOK (PAGE SETUP) ALL AT ONCE INSTEAD OF BY PAGE fred Excel Discussion (Misc queries) 1 August 11th 08 04:54 PM
HOW DO I SETUP A PAGE IN EXCEL TO GIVE TOTALS TO ANOTHER PAGE Randy Excel Worksheet Functions 1 February 8th 07 06:15 PM
Under Page Setup the page option of Ledger - for Office XP Turbo Excel Discussion (Misc queries) 2 September 27th 06 02:46 AM


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