How to Maximize Print Size

J

John Michl

I need to adjust the zoom settings on Page Setup to fill up the printed
page. (The reverse of condensing the page to fit on one page.)

Any ideas on how to do this with VBA? Manually playing with the zoom
settings isn't an option. I've created a mini-crossword app and the
print range changes based on the size of the puzzle. I don't want the
user to have to adjust the settings.

Since I've calculated the print range in VBA, I would assume that I
could calculate the combined width of the columns and length of the
rows. Could this be converted to something that would determine how
much of the page would be filled then adjust zoom accordingly?

Thanks for the ideas and any sample code.

- John
 
T

tiah

Hello

Here how I would do it in VBA, but maybe there is a better manner
Mine is to put the zoom at minimum and count page, if it is still 1, it
will continues to add zoom until page count is 2


Sub FitToPage()
Application.ScreenUpdating = False
For i = 10 To 400
ActiveSheet.PageSetup.Zoom = i
numPages = ExecuteExcel4Macro("Get.Document(50)")
If numPages > 1 Then
ActiveSheet.PageSetup.Zoom = i - 1
Exit For
End If
Next
End Sub
 

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


Top