Fix Cyrillic and Ukrainian Question Marks in Excel VBA
If the VBA editor replaces Cyrillic or Ukrainian letters with question marks, use Unicode ChrW expressions instead of source-code literals. Here's how to create, verify and reuse them.
Why Cyrillic or Ukrainian text turns into question marks
The classic Visual Basic Editor (VBE) does not always preserve non-ASCII characters typed directly into source-code string literals. The result may look like MsgBox "??????" even when Excel cells themselves display Cyrillic correctly. Changing the worksheet's font or number format cannot repair source text that was already replaced.
One practical workaround is to build the string at runtime from Unicode code units using VBA's ChrW function. It avoids relying on the editor to store those letters directly in a quoted literal.
Example: display Привіт without Cyrillic source literals
The word Привіт contains six Unicode characters. This VBA expression constructs them without embedding the characters in a string literal:
Sub ShowGreeting()
MsgBox ChrW(&H041F) & ChrW(&H0440) & _
ChrW(&H0438) & ChrW(&H0432) & _
ChrW(&H0456) & ChrW(&H0442)
End Sub
The resulting message is Привіт. For a single letter, ChrW(&H041F) returns П. For emoji or other characters outside the Unicode Basic Multilingual Plane, correct handling can involve two UTF-16 code units.
Generate the expression instead of calculating every code point
- Open the free Unicode to VBA ChrW converter.
- Paste the exact text that the macro should display, including punctuation and line breaks.
- Choose hexadecimal or decimal formatting for the
ChrWvalues. - Copy the expression into the VBA editor and replace the original corrupted string literal.
- Run the macro in a copy of your workbook and check the output.
The converter is browser-based and does not upload the text pasted into its editor. If you need a reusable function instead of one long expression, use the VBA function generator and review the generated module before importing it.
Common reasons the fix still looks wrong
The original text already contains question marks
A converter cannot reconstruct letters that were lost before you copied the text. Paste the correct original Unicode text from a trusted source.
Invisible extra line breaks appear
Copied text may end with CR or LF characters. Check the newline indicator on the tool and optionally remove trailing line breaks; don't remove intentional line breaks inside the text.
Code from an unknown source runs unexpectedly
Review generated or imported VBA before executing it. Never enable macros in unfamiliar workbooks just to test a Unicode conversion.
Only one system displays the text incorrectly
Distinguish storage from display: VBA source literals, Excel cells, file encodings, the Windows code page, and a target application can all behave differently. ChrW specifically solves constructing Unicode text in VBA; it cannot fix every downstream encoding mismatch.
Related tools
Decode a ChrW expression back to text to inspect an existing macro, or run the VBA code checker for a lightweight review of common code risks. These tools do not execute macros.
If a macro still fails, describe the problem through the paid macro troubleshooting service. Starting prices are indicative; no payment is taken through the inquiry form.