PDA

View Full Version : Screen Resolution



pico
11-24-2006, 08:05 PM
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.

Ken Puls
11-24-2006, 11:27 PM
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. :)

ndendrinos
11-25-2006, 08:02 AM
For example have my userform expand to the edjes of my excel sheet for example.
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% ...

Prasad_Joshi
11-27-2006, 02:48 AM
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

pico
11-27-2006, 12:53 PM
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.

lucas
11-28-2006, 07:32 AM
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....