An Excel UserForm usually changes size because VBA or its AutoSize setting changes its dimensions, or because Windows display scaling makes the same form appear different on screen. Check the form’s Width and Height properties, search its code for assignments to those properties, and confirm AutoSize is off before investigating display scaling.
What determines a UserForm’s size?
A UserForm’s Width and Height are measured in points, not pixels. A point is a typographic unit, so a form set to a particular width has a defined logical size even though the number of screen pixels used to draw it can vary with display settings. You can inspect the dimensions in the Visual Basic Editor (VBE): open the workbook, press Alt+F11, select the form in Project Explorer, and look at its Width and Height in the Properties window. If that window is not visible, press F4.
The form’s design-time dimensions are saved with the VBA project. When code loads the form, however, its event procedures can assign new dimensions or change related properties. A form that looks different after opening a particular file, running a button, or visiting a different monitor may therefore have a different cause than a form that was accidentally resized in the editor.
Also distinguish the outer form from its contents. A larger label, an expanded text box, or a different font can make the layout look wrong without changing the UserForm’s actual Width or Height. If the outside border is unchanged but controls appear crowded or misplaced, investigate control dimensions and positions as well as the form itself.
Common reasons the size changes
- VBA assigns dimensions. Code can set
Me.Width,Me.Height, or the form’s properties through another object reference. Search the VBA project for.Width,.Height, and the form’s name. Check the form module and any procedures that show or configure it. - AutoSize is enabled. A UserForm with AutoSize set to True can adjust to fit its contents. If controls change size or position, the form may no longer match the dimensions you expected. Select the form in the VBE and inspect AutoSize in the Properties window.
- The form was resized in the VBE. Dragging an edge or corner while designing changes its saved dimensions. This can happen while arranging controls, especially if the form is selected rather than an individual control.
- Windows display scaling or monitor changes affect rendering. A form can look larger, smaller, or less well aligned when Excel runs at a different display scale or moves between monitors with different scaling. The logical dimensions may be unchanged while the rendered appearance differs.
- Controls or fonts have changed. A label with its own AutoSize property, a longer caption, or a font change can alter the layout. This is especially noticeable when the UserForm itself uses AutoSize.
Check the form and its VBA code
Start with the simplest comparison: note the form’s Width and Height in the VBE before and after the action that seems to resize it. If the numbers change, the cause is likely a design edit or code. If the numbers stay the same but the form looks different, check Windows scaling, monitor configuration, and the layout of the controls.
Search the whole VBA project, not only the UserForm’s code module. In the VBE, use Edit > Find and search for terms such as .Width, .Height, and the form’s name. Pay attention to code in procedures that run when the form initializes or becomes active, and to macros that set up the form before displaying it. An assignment may be indirect, such as setting a property through a variable that refers to the form.
Compare the form’s properties with a saved or known-good copy if you have one. A design-time change can be easy to miss because the workbook still opens normally. If the workbook is shared, ask whether someone changed the form in the VBE or edited its code; the form’s design is part of the workbook’s VBA project, not an independent Windows setting.
How AutoSize and control layout affect the result
AutoSize is worth checking early because it can make a form respond to its contents rather than retain the dimensions you set in the designer. With AutoSize enabled, a control or caption that needs more space can affect the overall fit. That may be useful for a small dialog whose contents vary, but it is often inconvenient for a carefully arranged data-entry form.
For a fixed layout, set the UserForm’s AutoSize property to False and give the form enough room for its controls. Then check each control’s position and size in the Properties window. A control placed partly beyond the form’s edge can be clipped; a label that grows to fit a longer caption can overlap a neighboring control. These problems can look like the form itself has changed when only the contents have moved or expanded.
For example, suppose a form was designed with a short prompt, and later its caption or a label is changed to a much longer sentence. If the label has AutoSize enabled, it may grow horizontally or vertically. If the form also has AutoSize enabled, the outside dimensions may respond too. If the form has AutoSize disabled, the outside dimensions should remain fixed, but the label may still overlap other controls or be clipped. Adjust the control layout rather than relying on the form to resize itself.
Windows display scaling and multiple monitors
Display scaling changes how Windows maps logical interface dimensions to pixels. A display configured at 125% scaling uses more pixels for the same logical dimensions than a display at 100%. Office and Windows handle scaling according to their version and configuration, so the visible result can depend on the Excel build, Windows settings, and whether the workbook is shown on one monitor or another.
Check Settings > System > Display in Windows for the Scale and Display resolution settings. If the form changes appearance only after you move Excel between monitors, compare each monitor’s scale. Close and reopen Excel after changing display settings, since applications do not always redraw every interface element immediately. Do not change system scaling as a first fix if other apps look correct; first determine whether the form’s stored dimensions or code are actually changing.
Different scaling can expose layout weaknesses even when the form’s dimensions are stable. Controls may appear too close together, text may be difficult to read, or a button may seem to sit at a slightly different position. Test the form on the monitors and display settings its users actually use, and leave enough space around controls to tolerate small rendering differences. Avoid assuming that a particular pixel measurement will look identical on every screen.
What worksheet zoom does—and does not do
Worksheet zoom controls the display size of cells on a worksheet; it does not set a UserForm’s Width or Height. Changing a sheet from 100% to 80% can make the grid and its contents look smaller, but it is not a reliable way to resize a form. A form that appears to change alongside a worksheet may be responding to a separate VBA instruction or to screen scaling.
Likewise, Excel’s window size and the workbook window’s position do not automatically define the UserForm’s dimensions. They can affect where the form appears or how much of the desktop is visible, but they are separate from the form’s own Width and Height properties. This distinction helps avoid changing workbook zoom or display settings to solve a problem caused by code.
Keep a fixed-size form consistent
If a form should always open at the same dimensions, turn AutoSize off and set the dimensions deliberately. For example, place this code in that UserForm’s code module to set a width of 360 points and a height of 240 points when the form initializes:
Private Const FORM_WIDTH As Single = 360
Private Const FORM_HEIGHT As Single = 240
Private Sub UserForm_Initialize()
' Apply the intended dimensions before the form is shown.
Me.Width = FORM_WIDTH
Me.Height = FORM_HEIGHT
End Sub
Those values are examples, not universal recommendations; choose dimensions that fit the actual controls and text. Also check that another procedure does not assign different values later, and verify AutoSize is False. Save a copy of the workbook before changing or running VBA. Macro changes cannot be undone with Ctrl+Z, and a code edit can affect every user of the workbook.
Setting fixed dimensions controls the form’s logical size, but it cannot guarantee identical pixel appearance on every monitor. A sound layout uses appropriately sized controls, readable fonts, and some spare space rather than placing every element exactly against an edge. Test the form at the display scales used by its audience before distributing the workbook.
Excel for Mac and Excel for the web
This guidance is primarily for Excel for Microsoft 365 on Windows. Excel for the web does not run VBA macros or display VBA UserForms, so the desktop workbook must be opened in an Excel application to use a VBA form. If users need the workflow in a browser, a VBA UserForm is not a web-compatible interface.
Excel for Mac has a VBA editor and supports many VBA UserForm workflows, but Windows display-scaling instructions and Windows keyboard shortcuts do not apply directly. Mac display settings and form rendering differ, so validate the form on the Mac versions and screen configurations your users have. The VBE shortcut to open the editor also differs: on Windows, use Alt+F11; on Mac, the shortcut depends on the keyboard and Excel configuration, and the Visual Basic Editor can be opened from the Developer tab or Tools menu. The Properties window in the VBE can still be used to inspect form properties.
Frequently Asked Questions
Why does my Excel UserForm get bigger every time it opens?
Check whether AutoSize is True or whether code changes Width or Height during initialization or activation. If the property values stay constant, compare the Windows display scale and monitor used each time. A form that only appears larger may not actually have different stored dimensions.
Does changing worksheet zoom resize a UserForm?
No. Worksheet zoom changes how cells are displayed, not the UserForm’s Width and Height. Look for VBA assignments, AutoSize, or Windows display-scaling differences instead.
How do I stop a UserForm from resizing to fit its controls?
Select the form in the VBE, set its AutoSize property to False, and review code for assignments to its dimensions. Then check whether any individual controls are expanding or overlapping.
Why does my UserForm look different on another monitor?
Monitors can use different resolution and Windows scaling settings, and Office rendering can vary with the display configuration. Compare the monitors’ scale settings and test the form on the screens users will use; do not assume the point-based dimensions translate to identical pixels everywhere.
Can Excel for the web show a VBA UserForm?
No. Excel for the web does not run VBA UserForms. Open the workbook in desktop Excel to use the form, or choose a browser-compatible way to collect the required information.
Related
- Excel Turn Off Circular Reference Warning?
- Excel Circular Reference Warning: Causes and Fixes
- Absolute Reference in Excel Without F4: Manual Methods
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- VBA Array Cheat Sheet: Syntax, Bounds, and ExamplesA VBA array stores multiple values under one variable name, and the essential pattern is to declare it,…
- Excel SUBSTITUTE in VBA: Replace or WorksheetFunctionTo substitute text in Excel VBA, use VBA’s built-in Replace function; it replaces every matching occurrence by default.…
- VBA Array Add: How to Append Values and Resize an ArrayVBA has no built-in Array.Add method. To add values, use a dynamic array and resize it with ReDim…
- Print GMT Time Using Excel VBATo print the current GMT time with Excel VBA on Windows, call the Windows GetSystemTime API and send…
- Excel VBA Bold Text: Cells, Ranges, and Partial TextIn Excel VBA, make a cell or range bold by setting its Font.Bold property to True, such as…
- Excel VBA AutoFit: Resize Rows and Columns AutomaticallyIn Excel VBA, use the AutoFit method on the rows or columns you want to size. For example,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.