Excel UserForm: Change Font Size at Design Time or in VBA

VBA & macros · Updated November 2, 2026

Excel UserForm: Change Font Size at Design Time or in VBA

To change an Excel VBA UserForm’s font size, select the form or a control in the Visual Basic Editor, open its Properties window with F4, and change the size under Font. To set it with code instead, assign a number to the control’s Font.Size property, such as Me.Label1.Font.Size = 12.

Two ways to change a UserForm font

A UserForm is a VBA dialog box, and its text is controlled through font properties. You can set the font while designing the form, or use VBA to change it when the form opens or while it is being used. The design-time method is convenient when a form’s appearance should stay fixed. Code is useful when the size needs to be adjusted consistently across many controls or depend on a setting.

Font size is measured in points, as in other Office font settings. It is not a pixel measurement. A size of 12 means 12 points, although the apparent size can vary slightly with display scaling, font choice, and the computer displaying the form.

  • Design time: set the form or selected control’s Font property in the Visual Basic Editor. The setting is saved with the VBA project.
  • At run time: assign a size to the Font.Size property in an event procedure. The assignment applies to that displayed form instance; it does not rewrite the design-time setting in the project.

Change the size in the Properties window

In desktop Excel for Windows, open the workbook and press Alt+F11 to open the Visual Basic Editor. In the Project Explorer, open the workbook’s UserForm by double-clicking it. If the form is not visible, select it in the Project Explorer, then use View > Object. Press F4 to show the Properties window if it is hidden.

  1. Click the form itself to select it, or click the specific label, text box, button, or other control whose text you want to resize.
  2. In the Properties window, locate the Font property. Click its value or the adjacent ellipsis button to open the font dialog.
  3. Choose the desired value in the dialog’s Size box, then confirm. If the dialog is not available, expand or edit the Font property in the Properties window.
  4. Repeat for controls that should use a different size. Save the workbook as a macro-enabled workbook, such as an .xlsm file, if it contains VBA that must be retained.

Changing the form’s own Font property does not always give the visual result people expect for every child control. A label or button can have its own font setting, and a control’s individual setting may need to be changed separately. Select the actual text-bearing control and inspect its properties if its size does not change with the form.

You can select multiple controls in the form designer to adjust a property they share, but the Properties window only shows properties that can be applied to the entire selection. If Font is missing or the selection behaves unexpectedly, set each control separately or use a short code routine.

Set the font size with VBA

To apply a size as the form opens, put code in the UserForm’s Initialize event. In the Visual Basic Editor, open the form’s code window, choose UserForm from the left drop-down and Initialize from the right drop-down, then add the assignment. Replace lblTitle with the actual (Name) of a control on your form.

Private Sub UserForm_Initialize()
    Dim titleSize As Single
    ' Set the title label size when the form is initialized.
    titleSize = 14
    Me.lblTitle.Font.Size = titleSize
End Sub

For example, the code sets a label named lblTitle to 14 points each time a new instance of the form is initialized. The name in code is the control’s (Name) property, not necessarily the text displayed in its Caption property. If the control is still named Label1, either use that name in the code or change its (Name) property first.

You can set several known controls explicitly, which is clear and easy to maintain:

Private Sub UserForm_Initialize()
    Dim bodySize As Single
    Dim headingSize As Single
    ' Give the heading and input field separate sizes.
    headingSize = 14
    bodySize = 11
    Me.lblHeading.Font.Size = headingSize
    Me.txtName.Font.Size = bodySize
End Sub

This example assumes the form contains controls named lblHeading and txtName. It changes only those controls; it does not automatically resize every label, button, or other control on the form. The size values are points, so the example uses 14 points for the heading and 11 points for the input field.

Apply a size to a group of controls

When a form has many labels, setting each one in the Properties window can be repetitive. A loop can apply the same value to all labels. The following example deliberately targets labels only, leaving text boxes, buttons, and list controls at their existing sizes:

Private Sub UserForm_Initialize()
    Dim ctl As MSForms.Control
    ' Set every label on this form to 10 points.
    For Each ctl In Me.Controls
        If TypeName(ctl) = "Label" Then
            ctl.Font.Size = 10
        End If
    Next ctl
End Sub

The loop checks each control’s type before changing its font. This matters because a form can contain controls with different purposes, and a blanket change may make input fields or buttons look wrong. If you want a different group, add a type check for the specific control types you intend to change and verify the form in the editor and at run time. For a small form, explicit assignments are usually easier to understand than a broad loop.

Choose a useful size and check the layout

A larger font can make a form easier to read, but the font size is only one part of the layout. Controls have fixed positions and dimensions unless your code changes them, so enlarging text can cause a caption to be clipped, wrap unexpectedly, or look crowded. A larger font in a narrow button may not fit even though the size assignment itself succeeds.

After changing sizes, run the form and check the full dialog—not just the designer view. Look at the longest label and button caption, text-entry fields, and any controls near the edges. If the text no longer fits, widen the control, increase its height where appropriate, shorten its caption, or use a smaller size. For a UserForm with a consistent visual hierarchy, make headings visibly distinct but keep labels and input text readable and reasonably uniform.

  • Use the same size for controls with the same role, such as ordinary field labels.
  • Consider longer translated captions or names; a layout that fits short text may not fit longer text.
  • Check the form at the display scaling and resolution users are likely to use.
  • Do not enlarge text without checking whether the form itself or its controls need more space.

Common problems and fixes

The code says “Method or data member not found.” Check that the control name is correct and that the code is in the UserForm module containing that control. A control named TextBox1 in one form is not automatically available as Me.TextBox1 from another form. Also use the spelling Font.Size; there is no general UserForm control property named FontSize.

The wrong text changes. The control’s (Name) property identifies it in VBA, while Caption is the text shown on controls such as labels and command buttons. Confirm that you selected the intended control and that its name in code matches the Properties window.

Some text stays at its old size. A form can contain controls with individual font settings. Set the specific control’s Font.Size or its design-time Font property rather than assuming the form’s setting changes every child control. Also check whether code elsewhere resets the size after Initialize.

Text is too large or gets cut off. Changing Font.Size does not automatically redesign the form. Increase the control’s dimensions or adjust the caption and layout, then run the form again. The form designer’s visual appearance is not a substitute for checking the running dialog.

The change disappears after closing the form. A run-time assignment affects the loaded form instance, not the saved design-time property. Put the assignment in an initialization or other suitable event so it runs whenever the form is opened, or set the size in the designer if it should be permanent.

Excel versions, Mac, and the web

These steps are for desktop Excel for Microsoft 365 on Windows, where VBA UserForms are edited in the Visual Basic Editor. The Windows shortcut to open that editor is Alt+F11; F4 displays the Properties window when the editor is active. If the Developer tab is not visible, it can be enabled through Excel Options, Customize Ribbon.

Excel for Mac has a Visual Basic Editor and VBA, but keyboard shortcuts and the form-design experience can differ; on many Mac keyboards, Option+F11 (sometimes with Fn) opens the editor. Check the menus or keyboard settings if that shortcut is intercepted. If a workbook will be used on both Windows and Mac, test the form on both platforms rather than assuming identical rendering or control behavior. Excel for the web does not run VBA macros or display VBA UserForms, so a UserForm-based workflow requires desktop Excel.

Changing a UserForm font is a visual formatting task and does not alter worksheet cell fonts. It also does not require changing Windows display settings. If your intended interface is a worksheet form rather than a VBA dialog, format the worksheet cells or controls themselves; a UserForm’s Font property will not change those objects.

Accessibility and alternative approaches

Increasing font size can improve legibility, but it is not a complete accessibility solution. Use clear labels, good contrast, and sensible tab order as well. Avoid relying on color or size alone to communicate an instruction or error. For example, an error should have explanatory text rather than being indicated only by a red label.

If a UserForm is not essential, consider whether a worksheet-based input area, a table with data validation, or a Microsoft Forms-based workflow better suits the users and devices involved. Those options have different capabilities and do not use the UserForm Font.Size property. A UserForm remains appropriate for a VBA-driven desktop workflow, but it is not usable in Excel for the web and may require platform-specific testing.

Frequently Asked Questions

What is the VBA property for changing a UserForm font size? Use the Font object’s Size property, as in Me.TextBox1.Font.Size = 12. Replace TextBox1 with the control’s actual (Name). The number is a point size.

Can I change the font size of every control at once? You can select multiple controls in the designer and change a shared property when the Properties window offers it. In code, loop through Me.Controls and filter for the control types you want; changing only labels, for example, avoids unintentionally changing input fields.

Does changing the UserForm font resize the controls? No. Font-size changes do not automatically expand the form or its controls. Review the layout and adjust control dimensions or captions where text no longer fits.

Should the code go in Initialize or Activate? Use Initialize for settings that should be applied as the form is set up, such as initial font sizes. Activate runs when a form becomes active, so it can run again when focus returns; use it only when that repeated behavior is intended.

Will a VBA UserForm work in Excel for the web? No. Excel for the web does not run VBA macros or show VBA UserForms. Use desktop Excel for a workbook that depends on this kind of form.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.