VBA & Macro Problems

Fix Question Marks Appearing in Spreadsheet VBA Modules

Aamir Naveed AkramAamir Naveed Akram Oct 12, 2026 869 views

Question details

Non-Latin characters display as question marks in the Visual Basic Editor and macro messages.

Fix Question Marks Appearing in Spreadsheet VBA Modules
Product
Spreadsheets
Device & OS
not provided
Scenario
Typing, pasting, or displaying text containing non-Latin characters (like Greek, Cyrillic, or Arabic) within VBA code or message boxes.
Observed behavior
The text characters are incorrectly converted to and displayed as question marks (?).
Before you start

Confirm whether your script strictly requires embedded special characters, as standard VBA editors have limited native support for Unicode character sets.

Solution 1Recommended

Store and Retrieve Unicode Text from Worksheet Cells

Bypass the VBA Editor's text encoding limitations by keeping special characters in the spreadsheet rather than the code.

Because the standard Visual Basic Editor converts unsupported Unicode characters to question marks, directly hardcoding non-Latin text is not recommended. You can safely store these strings in the spreadsheet cells, which have full Unicode support.

1
Store text in the spreadsheet

Open your workbook and type the required non-Latin characters (e.g., Arabic or Cyrillic) directly into a specific cell, such as A1 on Sheet1.

2
Reference the cell in VBA

In your macro, read the value directly from the cell using code like 'myText = Sheets("Sheet1").Range("A1").Value' instead of typing the string inside quotes.

Store and Retrieve Unicode Text from Worksheet Cells
VBA MsgBox Limitations: Even if stored correctly in a cell, the standard VBA 'MsgBox' function may still show question marks. Use alternative display methods like UserForms.

Write and Execute VBA Macros Efficiently in WPS Spreadsheet

WPS Office Spreadsheet provides excellent support for VBA macros, allowing you to create, edit, and run complex scripts to automate your workflow seamlessly.

  1. 1. Open your Spreadsheet: Launch WPS Spreadsheet and open your macro-enabled workbook containing your data.
  2. 2. Access Developer Tools: Navigate to the Developer tab on the top ribbon. If hidden, you can enable it through the software settings.
  3. 3. Open Visual Basic Editor: Click on 'Visual Basic' or press Alt+F11 to open the code editor and manage your VBA scripts.
Highly compatible with Microsoft Excel VBA formats (.xlsm, .xltm)Familiar Developer tab and Visual Basic Editor interfaceLightweight processing for large datasets and complex macro scripts
microsoft office alternative - wps office

Frequently Asked Questions

Why do foreign languages look like question marks in my VBA code?

The Visual Basic Editor operates on standard ANSI encoding. When you insert characters outside your system's default locale (like Arabic, Cyrillic, or Greek), the editor cannot recognize them and defaults to showing question marks.

Can I change the font in the VBA Editor to fix the question marks?

Changing the editor font in the VBE Options to a font that supports the required character set (like Arial Unicode MS) may help display characters properly, but only if your Windows system locale matches the language you are trying to display.

How can I display Unicode text in a popup message if MsgBox shows question marks?

The built-in VBA MsgBox function does not natively support Unicode. To display non-Latin text properly to users, you can design a custom UserForm with text labels, or use the Windows API MessageBoxW function.