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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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