1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: excel screen size

Discussion in 'Business Applications' started by scouse13, Apr 21, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. scouse13

    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
     
  2. etaf

    etaf Moderator

    Joined:
    Oct 2, 2003
    Messages:
    65,421
    First Name:
    Wayne
  3. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    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
     
  4. scouse13

    scouse13 Thread Starter

    Joined:
    Oct 29, 2009
    Messages:
    137
    thanks keeballah

    where do u put the function display code within the workbook
     
  5. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    I suggest you put it in the Auto_Open or else in sheet code of the sheet that is activated on opening the workbook
     
  6. scouse13

    scouse13 Thread Starter

    Joined:
    Oct 29, 2009
    Messages:
    137
    thanks keeballah works a treat
     
  7. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    It's a neat option, I use it when the opening worksheet is destined to be used as a menu
    Glad it helped.
     
  8. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/918373

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice