Consulting

Results 1 to 6 of 6

Thread: Screen Resolution

  1. #1
    VBAX Contributor
    Joined
    Nov 2006
    Posts
    107
    Location

    Screen Resolution

    I have created a macro in excel for those of you who dont already know. I have a user form that runs on the screen. The problem iam facing is when i try to load the macro on different types of computer screens the userform does not remain the same size. Is there a way to correct form resolution in vba?. Or am i just dreaming?. If no, is there a way to get around it?. For example have my userform expand to the edjes of my excel sheet for example. Any suggestions would be helpful. Note: I dont want to change the user's screen resolution. But i'd like to resize my userform according to their screen resolution. Iam writing my macro in 1024x768 resolution. Also, when i resize my userform i'd like it to be almost or close to the legibility as my original screen.
    Last edited by pico; 11-24-2006 at 08:31 PM.

  2. #2
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Hi Pico,

    From our KB:
    Screen Resolution Check / Change
    Set your workbook to adjust to users screen resolution

    I wouldn't recommend changing your users screen resolution either, but these should give you the ability to check the resolution that your users are using. From there, you need to resize the userform, and you can do this by adjusting the width and height properties of your userform.

    If you need help with that portion, let us know.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  3. #3
    VBAX Mentor
    Joined
    Sep 2004
    Posts
    431
    Location
    [vba]For example have my userform expand to the edjes of my excel sheet for example. [/vba]
    Hello Pico. When faced with the same problem I've used the Zoom and "save as" for each resolution with an extra line in the form macro so that on close it brings back the zoom to 100% ...
    Thank you for your help

  4. #4
    Try this one.
    Private Sub UserForm_Activate()
    Application.WindowState = xlMaximized
    With Application
    Me.Top = .Top
    Me.Left = .Left
    Me.Height = .Height
    Me.Width = .Width
    End With
    End Sub

  5. #5
    VBAX Contributor
    Joined
    Nov 2006
    Posts
    107
    Location
    Is there a way i can test my userforms for different resolutions? and has anyone tried resizing their userforms to the users excel window? If so what's the best resolution to have when developing your userforms so that when they are resized they maintain the same legibility.

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi pico,
    your best bet here is in Kens post #2 in this thread...
    you will have to incorporate the two methods
    one checks the users screen resolution. You can use that feedback to use the second method in Kens post to adjust your userform size to their screen resolution....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •