How to make a VBA Userform - Full Screen

michaeldh

Board Regular
Joined
Jun 11, 2002
Messages
201
Mr Excel,

I have created a userform in Visual Basic which automatically pops up when a workbook is opened. I would like it to appear in full screen mode ie self adjust to the users PC display settings / acceleration.

Is there a way to do this...if not I will have to design the form a little smaller to suit all needs (not the best solution but).

If you could help, I would be most appreciative.

Michael.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Michael,

Please try this code.
If you want to keep the ratio, zoom property makes it possible.

<pre>
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With
End Sub
</pre>
 
Upvote 0
for some reason i get the error runtime 380, could not set the zoom property please enter a value between 10 and 400?
 
Upvote 0
Your userform is too small compared to the size of your screen. Make it bigger if you want to use this method.
 
Upvote 0

Forum statistics

Threads
1,223,604
Messages
6,173,312
Members
452,510
Latest member
RCan29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top