To insert the circle M symbol (Ⓜ) in VBA, you can use the Unicode character code &H24C2 with the ChrW() function. This method works in Excel, Word, or any Office application that supports VBA and displays Unicode characters correctly. The circle M symbol is useful for labeling, indicators, or UI elements where visual clarity matters more than text. No external tools or add-ins are needed—only basic VBA knowledge and a compatible font like Segoe UI Symbol or Arial Unicode MS.
What You'll Need
- Microsoft Excel, Word, or another Office application with VBA support
- Access to the VBA Editor (press Alt+F11)
- A cell, text box, label, or message box where you want the symbol to appear
- A font installed on your system that supports Unicode symbols (Segoe UI Symbol is recommended)
Step-by-Step
- Open the Office application where you want to insert the symbol (e.g., Excel or Word).
- Press Alt+F11 to open the Visual Basic for Applications (VBA) Editor.
- In the Project Explorer on the left, double-click the module where you want to add the code, or right-click your project, choose Insert > Module to create a new one.
- Clear any existing code in the module if needed, then type or paste the following line:
Range("A1").Value = ChrW(&H24C2). This writes the circle M symbol to cell A1. - If you're using a label on a UserForm, use:
Label1.Caption = ChrW(&H24C2). Replace "Label1" with your actual label’s name. - If you want to display it in a message box, use:
MsgBox ChrW(&H24C2). - Save your file as a macro-enabled workbook (.xlsm) if using Excel, or .docm if using Word.
- Run the code by pressing F5 while your cursor is inside the subroutine, or assign it to a button or shortcut.
- After running, check the target cell or control. If you see a question mark or empty space, proceed to the Troubleshooting section.
- To ensure the symbol displays correctly, select the cell or control and change its font to Segoe UI Symbol, Arial Unicode MS, or another Unicode-capable font via the Home tab or in code with
Range("A1").Font.Name = "Segoe UI Symbol".
Common Mistakes
- Using Chr() instead of ChrW(). Chr() only supports ASCII (0–255), but the circle M symbol is Unicode (U+24C2), requiring ChrW().
- Using a font that doesn't support Unicode symbols. Default fonts like Calibri or Times New Roman may not render the symbol, showing a box or blank.
- Typing the hex code incorrectly: &H24C2 is correct; &H24c2 (lowercase) also works, but &H24C3 or &H24B2 are different symbols.
- Expecting the symbol to appear in a non-Unicode environment, such as older systems or plain text files.
- Forgetting to save the file as macro-enabled, which causes the code to be lost when closing.
Tips
- Use
Debug.Print ChrW(&H24C2)in the Immediate Window (Ctrl+G) to test the symbol before placing it in a UI element. - If you're inserting the symbol repeatedly, define a constant:
Const CIRCLE_M As String = ChrW(&H24C2)and use CIRCLE_M in your code. - Combine it with text:
Range("A1").Value = "Status: " & ChrW(&H24C2)for clearer labeling. - Test font rendering on different machines—Segoe UI Symbol is standard on Windows 8+, but older systems may need Arial Unicode MS.
- For dynamic placement, use a loop:
For i = 1 To 10: Cells(i, 1).Value = ChrW(&H24C2): Next ito fill a column. - Always test your output on the target machine, especially if distributing the file to others.
Troubleshooting
- Symbol shows as a square or question mark: Change the font of the target cell or control to Segoe UI Symbol or Arial Unicode MS. If you can't change it manually, add the font assignment in code:
Range("A1").Font.Name = "Segoe UI Symbol". - Runtime error: Invalid procedure call or argument: You likely used Chr() instead of ChrW(). Replace Chr() with ChrW() and ensure the hex code is &H24C2.
- No symbol appears after running code: Check if the target cell is protected or locked. Unprotect the sheet via Review > Unprotect Sheet if needed.
- Code runs but symbol doesn't show in message box: Message boxes use system default fonts that may not render Unicode. Use a label on a UserForm instead for reliable display.
- Symbol appears on one computer but not another: The other machine may lack a Unicode font. Install Segoe UI Symbol (usually preinstalled on Windows 8+) or Arial Unicode MS. If unavailable, consider using a different symbol like "(M)" as fallback.
- Macro security blocks code execution: Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select "Enable all macros" temporarily for testing, or sign your macro with a certificate for production use.