logo
search
VBA & Macro Problems

How to Display a Checkmark in a VBA Message Box

Kushani NimanthikaKushani Nimanthika Oct 9, 2026 868 views

Question details

The user wants to display a checkmark (success) icon in a VBA message box instead of the standard error 'X' icon.

How to Display a Checkmark Instead of an X in a VBA Message Box
Product
VBA / Spreadsheet
Device & OS
not provided
Scenario
Creating a success confirmation prompt with a checkmark after a macro completes its execution.
Observed behavior
The standard VBA MsgBox only supports four built-in icons (vbCritical, vbQuestion, vbExclamation, vbInformation) and cannot natively display a custom checkmark.
Before you start

Before modifying your macro, save your workbook as a Macro-Enabled Workbook (.xlsm) to prevent losing your VBA code, and ensure the Developer tab is enabled in your ribbon menu.

Solution 1Recommended

Use a UserForm to Create a Custom Dialog

Since the standard MsgBox cannot display custom icons, creating a UserForm allows you to fully customize the dialog box with a checkmark image, specific text, and buttons.

The built-in VBA MsgBox function is strictly limited to four system icons. By designing a custom UserForm, you bypass these limitations entirely. This allows you to insert any image file, such as a green checkmark, to clearly indicate a successful operation to the user.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor.

2
Insert a UserForm

Click on 'Insert' in the top menu bar and select 'UserForm' to create a new blank dialog box.

3
Add a Checkmark Image

Use the Toolbox floating window to add an 'Image' control to your UserForm. In the Properties window, find the 'Picture' property and load a checkmark image from your computer.

4
Add Text and a Button

Add a 'Label' control for your success message text. Then, add a 'CommandButton' for the 'OK' action. Double-click the button and enter 'Unload Me' in its click event code to close the form when clicked.

5
Call the UserForm in Your Macro

Replace your standard MsgBox code in your main macro with 'UserForm1.Show' to display your custom checkmark dialog.

Use a UserForm to Create a Custom Dialog
Customization Complete: Using a UserForm not only lets you add a checkmark but also allows you to change fonts, background colors, and add custom button behaviors.
Advanced VBA Macro Support

Create Custom VBA Dialogs in WPS Spreadsheet

WPS Spreadsheet provides a comprehensive built-in VBA editor in its premium and professional editions, allowing you to easily design UserForms, write macros, and automate your workflow with high compatibility.

  1. 1. Enable the Developer Tab: Open WPS Spreadsheet, go to the Options menu, and enable the Developer tab to access macro tools.
  2. 2. Launch the VBA Editor: Click on the 'VBA Editor' button within the Developer tab to open the macro programming environment.
  3. 3. Design Your UserForm: Insert a new UserForm and easily drag-and-drop labels, buttons, and custom checkmark images using the toolbox.
  4. 4. Execute Your Code: Run your macro directly within WPS Spreadsheet to display your custom dialog instantly.
Fully supports standard VBA code and advanced UserForm creationHighly compatible with Microsoft Excel .xlsm and .xlsb macro formatsLightweight design with fast macro execution speedsFamiliar Developer tab and code editor interface for seamless migration
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a Unicode checkmark character inside a standard VBA MsgBox?

The standard VBA MsgBox does not natively support Unicode characters. If you try to paste a Unicode checkmark into the prompt text, it will usually display as a question mark (?) or an unrecognized square block.

What are the four default icons available in a VBA message box?

The standard VBA MsgBox only supports vbCritical (a red X), vbQuestion (a question mark), vbExclamation (a yellow warning triangle), and vbInformation (a blue 'i').

How do I remove the icon entirely from my MsgBox?

If you omit the icon parameter in your MsgBox code entirely (for example, MsgBox "Your message here"), no icon will be displayed. This is often preferable to showing an inappropriate default icon.