VBA MsgBox Bold Text: Limits and Better Alternatives

VBA & macros · Updated November 18, 2026

No: VBA’s built-in MsgBox cannot make selected words bold or apply rich-text formatting. If you need bold text, use a VBA UserForm with labels and set a label’s Font.Bold property to True; for a simple message, keep MsgBox and make the wording clear with line breaks and a useful title.

Why MsgBox cannot format text

MsgBox displays a standard message dialog. Its prompt is a string, not a rich-text document, so the function has no argument for font weight, font size, color, or formatting just part of the prompt. Adding HTML tags such as <b>, Markdown markers such as **important**, or other markup does not help: those characters are shown as ordinary text rather than interpreted as formatting.

The dialog’s appearance is managed by Windows and the Office/VBA environment. A user may see different font sizing or other visual details because of Windows display settings, accessibility settings, or system theme, but that does not give the macro control over bolding one phrase. There is no supported MsgBox setting that changes this limitation.

This distinction matters because the familiar dialog looks like a small text box, but it is not an editable control that VBA can style. VBA supplies the message and options; the operating system draws the standard dialog. A request to “bold one word in MsgBox” therefore needs a different interface, not a special character or an undocumented formatting code.

What MsgBox can customize

Although formatting is fixed, MsgBox does offer useful control over its content and behavior. Its prompt can contain multiple lines, and its buttons, icon, default button, and title can be selected through the function’s arguments. A concise title and an appropriate icon often make an important message easier to recognize without relying on bold type.

For example, this code presents a confirmation with a question icon and two choices. The prompt uses vbCrLf to put the second sentence on a new line:

Sub AskBeforeContinuing()
    Dim answer As VbMsgBoxResult

    ' Show a standard confirmation dialog with a clear title.
    answer = MsgBox("Continue with this operation?" & vbCrLf & _
                    "Review the selected records first.", _
                    vbYesNo + vbQuestion, "Confirm operation")

    If answer = vbYes Then
        ' Put the action to run after a Yes response here.
    End If
End Sub

The variable is declared as VbMsgBoxResult, which is suitable for checking the returned choice. The vbYesNo and vbQuestion constants combine to choose the buttons and icon; the final argument supplies the title. None of these options changes the prompt’s font.

For the Excel version of VBA, put a macro in a standard module in the Visual Basic Editor. The same basic MsgBox function is available in other VBA hosts, though the surrounding project and editor can differ. In Excel for Microsoft 365 on Windows, open the editor with Alt+F11. On a Mac, the VBA editor shortcut and available macro environment differ by keyboard and Excel setup; use the Visual Basic Editor command available in Excel rather than assuming a Windows shortcut.

Use a UserForm for bold text

A UserForm is the usual built-in VBA alternative when a message needs different visual styles. Unlike MsgBox, it contains controls such as labels and command buttons. A label can be set bold through its Font.Bold property. The important limitation is that this property applies to the label control as a whole: it does not bold only a selected word within one label.

To show both bold and regular text, put the bold phrase in one label and the remaining text in another. Arrange the controls so that they read naturally, or put the bold heading above the explanatory label. A UserForm gives you more control over spacing, size, labels, and buttons, but it takes more setup than a one-line MsgBox.

In the Visual Basic Editor, insert a UserForm and name it frmNotice. Add a label named lblHeading, another named lblDetails, and a command button named cmdOK. Set their positions and sizes in the Properties window. For a heading that should wrap, set the appropriate label’s WordWrap property to True and make the control large enough to display its text.

Example: a bold heading on a UserForm

Place the following event code in the form’s code module. It makes the heading label bold, leaves the detail label in its normal style, and closes the form when the button is clicked. The text is split between controls because a standard MSForms label does not provide inline bold formatting for only part of its caption.

Private Sub UserForm_Initialize()
    Dim headingText As String
    Dim detailsText As String

    ' Keep the heading and explanation in separate controls.
    headingText = "Important: check the selected range"
    detailsText = "The next step may change cell contents."

    Me.lblHeading.Caption = headingText
    Me.lblHeading.Font.Bold = True
    Me.lblDetails.Caption = detailsText
End Sub

Private Sub cmdOK_Click()
    ' Close this form when the user selects OK.
    Unload Me
End Sub

To display the form from a standard module, use an object variable as shown below. The vbModal argument keeps the form in front until the user closes it, which is often appropriate for a notice that requires acknowledgment.

Sub ShowFormattedNotice()
    Dim notice As frmNotice

    ' Create and display the custom notice form.
    Set notice = New frmNotice
    notice.Show vbModal
End Sub

Adjust the form’s dimensions and control layout in the designer; the example does not automatically position or resize controls. Before running a macro that interacts with workbook data, save a copy of the workbook. VBA macros cannot be undone with Ctrl+Z, so a backup is a sensible precaution even when the example is only intended to display a notice.

Choose between MsgBox and a UserForm

Use the simplest interface that communicates the message and lets the user respond safely. A standard dialog is usually better for a brief warning or Yes/No decision. A UserForm is a better fit when formatting, longer explanations, several fields, or a more tailored arrangement genuinely improves the interaction.

  • Choose MsgBox for a short notice, a basic confirmation, or a small set of standard buttons. It is quick to write and does not require a form to be designed.
  • Choose a UserForm when a heading should stand out, when users need to enter or review information, or when the dialog needs more structure than a prompt and standard buttons allow.
  • Choose a worksheet message when the information should remain visible after a dialog closes or should be printed, shared, or reviewed alongside the data.
  • Choose a task pane or another interface only if the project’s requirements justify the extra development and maintenance. A more elaborate solution is not automatically more usable.

It is usually not worth trying to alter the system dialog with Windows API calls just to bold text. API-based dialog customization is separate from the normal VBA MsgBox function, can involve Windows-specific declarations and compatibility concerns, and is more fragile than a UserForm. In particular, code written for Windows should not be assumed to work in Excel for Mac. For ordinary workbook automation, the form is the clearer option.

Common problems and practical fixes

If markup appears literally in the dialog, that is expected: MsgBox does not parse HTML or Markdown. Remove the markup, or move the text into a UserForm control that can be styled. Likewise, changing the font of a worksheet cell or a UserForm label does not change the font of an already-open MsgBox.

If the UserForm heading is not bold, check that the code is in the correct form module, that the control is really named lblHeading, and that the property is set on that label. Control names are not interchangeable with their captions: the name identifies the control in VBA, while the caption is the text displayed to the user. If a label is clipped, increase its height or width, or enable word wrapping and test the form at the display size users are likely to use.

Do not use bold as the only way to signal a serious condition. A heading such as “Important” or “Action required,” a specific explanation, and a clear button label are useful even when someone cannot distinguish the styling. Keep the message direct: explain what will happen, what the user should check, and what each available choice means. A generic “Are you sure?” often gives less useful information than a sentence naming the action.

When a dialog offers Yes and No, make sure the code checks the returned value and that each response has an intentional result. Do not assume the user will select the safer option. Also consider whether a cancel choice is needed; if the task is destructive or difficult to reverse, the interface should make the consequence clear before the action runs.

Frequently Asked Questions

Can I bold one word inside a VBA MsgBox?
No. The prompt is plain text, and MsgBox does not support inline font formatting. Use separate UserForm labels if one phrase needs to be bold while the rest remains regular.

Does HTML or Markdown make MsgBox text bold?
No. Tags such as <b> and markers such as **word** are displayed as characters; the dialog does not interpret them as formatting instructions.

Can I make the entire MsgBox message bold?
There is no supported VBA argument to set the message font bold, even for the whole prompt. Windows may change the dialog’s overall appearance through system settings, but that is not a per-message formatting feature.

Can a UserForm bold only part of a label’s caption?
A standard MSForms label’s bold setting applies to the label’s font, not an arbitrary substring. Use separate labels for the bold and regular portions, or consider a more specialized control only if the project can support its additional setup.

Will a Windows API solution work on a Mac?
Do not assume so. Windows API techniques are Windows-specific, while Excel for Mac has a different environment. A UserForm or a worksheet-based message is generally a more portable choice, though form behavior should still be checked in the versions and platforms you support.

What is the easiest alternative to a bold MsgBox?
For one emphasized heading, create a small UserForm with a bold label, a regular explanatory label, and an OK button. If formatting is not essential, keep the standard dialog and use a clear title and concise wording.

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.