Auto-adjust According to Resolution

R

Risky Dave

Hi,

I have an application that forces my users to navigate about it using a set
of buttons. When this is run on different users machines (with different
screen resolution settings) the formatting of the page gets knocked off.

Is it possible to have XL recognise the resolution that a given instance is
set to and auto adjust the % slider (this is in Office '07 under Vista) to
ensure that a specific area of the sheet is displayed?

TIA

Dave
 
T

Trevor Williams

Hi Dave - this is a 'quick and dirty' method, and sombody may give a cleaner
answer:

You can use the 'zoom to selection' option e.g. if your sheets used columns
A-S you can select the columns and 'zoom to selection' - maybe trigger it
using the Workbook_open event

Sub ResizeSheets()
Dim sh as worksheet
For each sh in activeworkbook.worksheets
sh.select
Range("A1:S1").Select
ActiveWindow.Zoom = True
 
T

Trevor Williams

Sorry Dave - a bit premature there!
Here's the code...

Sub ResizeSheets()
Dim sh as worksheet
Application.Screenupdating = False
For each sh in activeworkbook.worksheets
sh.select
Range("A1:S1").Select
ActiveWindow.Zoom = True
Next sh
Application.Screenupdating = True
End sub

As far as I'm aware you have to use the 'select' option on the sheets and
the range.

HTH - Trevor Williams
 

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

Top