Link to home
Start Free TrialLog in
Avatar of panikos
panikos

asked on

Making a spreadsheet fit on the screen

I have a spreadsheet that needs to be looked at by lots of people on different PCs. Each PC will have its own settings and therefore whenever they receive the excel spreadsheet I send thm it doesn't appear nicely on the screen. Often all they need to do is change the zoom setting to view normally.

Is there some way that I can force my workbook to autofit on the user's screen regardless of their resolution.
I seem to remember something about xlstartup and autofit to screen functions in VBA but not sure how to use them.

Please help
Avatar of JustinCase2
JustinCase2

Hi panikos,

A thought would be to try...

Sub Fill_Screen()
   ActiveWindow.Zoom = True
End Sub

...called from (or the code embedded in) an Auto_Open() macro.

Regards,
Justin
Here's a line of code I use in one of my spreadsheets.  It's a spreadsheet a done some time ago, and I have to say I've no idea why I divide by 750, but it seems to work anyway!!!


ActiveWindow.Zoom = (ActiveWindow.UsableWidth / 750) * 100
ASKER CERTIFIED SOLUTION
Avatar of Suat M. Ozgur
Suat M. Ozgur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of panikos

ASKER

This may sound  like a stupid question but please bear with me...

How can I make sure that the code above will execute when my users open the workbook? Will this be done automatically? I am using the code from smozgur
>Code goes into Thisworkbook module's Workbook_Open event sub.

YEs, it will be done automaticially. Because;
Workbook_Open event sub is the one which is executed automaticially when the user opens the workbook.

Suat