Solved: excel screen size

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

scouse13

Thread Starter
Joined
Oct 29, 2009
Messages
137
i am using excel 2003, i have designed a worksheet showing all the information i need, the worksheet displays correctly on my laptop which has a 15.4'' screen, but when i copy the worksheet to my mates laptop who is also running excel 2003 but which has a 15.6'' screen the worksheet does not fill the screen as it does on mine, i know the screen sizes are not the same but is there a way using VBA or some other way to ensure the worksheet layout fills a particular screen size

many thanks
 

etaf

Wayne
Moderator
Joined
Oct 2, 2003
Messages
65,487

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,656
Maybe this helps:

Function DisplayVideoInfo() As Variant
Application.WindowState = xlMaximized
Dim zmRatio As Variant
Dim vidWidth As Long, vidHeight As Long
On Error Resume Next
If Left(Application.Version, 1) = 5 Then
vidWidth = GetSystemMetrics16(SM_CXSCREEN)
vidHeight = GetSystemMetrics16(SM_CYSCREEN)
Else
vidWidth = GetSystemMetrics32(SM_CXSCREEN)
vidHeight = GetSystemMetrics32(SM_CYSCREEN)
End If
'MsgBox vidwidth & Chr(13) & vidheight
If vidWidth = 800 Then
ActiveWindow.Zoom = 100
ElseIf vidWidth = 1024 Then
ActiveWindow.Zoom = 150
ElseIf vidWidth = 1152 Then
ActiveWindow.Zoom = 175
ElseIf vidWidth = 1280 Then
ActiveWindow.Zoom = 200
ElseIf vidWidth = 1600 Then
ActiveWindow.Zoom = 250
End If
' MsgBox ActiveWindow.Zoom
End Function

Another option I use more often is the following: (add the lines of code to the auto_open and

sheets("sheet1").select <<< the sheet you open in
Range("A1:I20").Select <<< this the range you want visible
ActiveWindow.Zoom = True

If you do this that area will zoom to fit the window, so it varies depending on the screen size
 

scouse13

Thread Starter
Joined
Oct 29, 2009
Messages
137
thanks keeballah

where do u put the function display code within the workbook
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,656
I suggest you put it in the Auto_Open or else in sheet code of the sheet that is activated on opening the workbook
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,656
It's a neat option, I use it when the opening worksheet is destined to be used as a menu
Glad it helped.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top