Printing: Best Fit (1 Page Wide)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im trying to write this small macro. I need to print a report which should be
the biggest font possible, but no more than 1 page wide. The sh is already
setup as landscape an centered. It can be any number of pages tall.

There are certain things the user could do to change the number of
rows/columns so this has to happen on the fly. I expect to use the
Workbook_BeforePrint event.

I thought of using a Do Until Loop as follows:

Sub BestFitPrint()
Sheet5.PageSetup.Zoom = 100
Do Until Sheet5.VPageBreaks.Count = 0
Sheet5.PageSetup.Zoom = Sheet5.PageSetup.Zoom - 5
Loop

Sheet5.PrintOut
End Sub

It's unlikely that the user will ever be able to print bigger than 100%

Does anyone have a better idea?
I would appreciate some help

Thanks in advance!
--
.- -. Bye Bye
/|6 6|\ - Pavlos
{/(_0_)\}
/ ^ \_
(/_/^\_\)
 
see what this does for you.
Sub zoomit()
ActiveSheet.UsedRange.Select
ActiveWindow.Zoom = True
End Sub
 
Don Im afraid this doesn't seem to work . It seems to change only the screen
font size not the print font size. It doesn't affect the page breaks.

Thanks anyway
 
Pavlos,
How about:
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 100
End With

The "Tall" value should be higher than the number of pages that will be
printed.

NickHK
 
NickHK
I must say, I had thought of that. It's similar to the XL help. Im not sure
why I didn't try it - I will give it a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

PDF export add-in 2
Publish as PDF/XPS Strange 1
Update worksheets 1
PageSetup 3
Page Setup Not Fitting To One Page Wide 3
Need Macro to Print Current Page Only (2) 7
Print Ranges 7
Printing App 2

Back
Top