View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Tips for optimising page setup .Zoom and .FitTo properties

Frank,
One way would be to apply your initial conditions, then check the
..HPageBreaks.Count & .VPageBreaks.Count properties to see how Excel will
deal with your combination of data, paper size and printer limitations.
If this yields unsuitable results, apply your rules below under the desired
result is achieved.

NickHK

"Frank_Hamersley" wrote in message
...
I am trying to discover a way to optimise the .PageSetup properties of a
sheet (in VBA) so the user can simply click PrintPreview or Print...

without
needing to adjust any properties to make the printed report readable.

The sheet concerned can have a variable amount of data and I want to
implement the following rules. Starting with .Orientation=xlLandscape...
a) if it fits on a single page leave it as is,
b) if the page appears to be narrow and long switch to xlPortrait to
maximise use of the page,
c) set a .Zoom % to achieve a 1 page wide print job (and 1 or more pages
down) so long as the .Zoom percentage does not go below (say) 50% (ie.

avoid
an unreadable "greeked" result).

Has anyone been here before (in Excel 2K)? NB the .UsedRange property is
viable on this sheet!

Cheers,
Frank.