Vba Forms resizing themselves

steveh8204

Board Regular
Joined
Aug 20, 2018
Messages
151
I am creating forms and setting the size but when I run them the are automatically resizing quite large. Even when I go back and change back they go large again the next time I run it.

None of the elements within are set to auto resize and I don't believe there is an auto resize on the form itself.

I've even set the size in the initialize function but it doesn't make a difference.

Has anyone else had this issue?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Are you running this on different computers with different resolutions?

You could add some code in the UserForm_Initialize SUB to resize it.
VBA Code:
Private Sub UserForm_Initialize()
  UserForm1.Width = 420
  UserForm1.Height 211.2
End Sub
 
Upvote 0
Are you running this on different computers with different resolutions?

You could add some code in the UserForm_Initialize SUB to resize it.
VBA Code:
Private Sub UserForm_Initialize()
  UserForm1.Width = 420
  UserForm1.Height 211.2
End Sub
I've just had a further play around and it seems to be due to my laptop display settings. As it's a small screen it's at 150% zoom.

If I select 100% zoom, edit the form and save them go back to 150% zoom it's fine. Just if I save while zoomed it reverts to much bigger.

A bit stupid but at least I've got a work around. I'd already tried the code in the initialize function although I'd used Me instead of the form name but either way it makes no difference.

Thanks anyway.
 
Upvote 0

Forum statistics

Threads
1,221,621
Messages
6,160,880
Members
451,676
Latest member
Assy Bissy

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