1

I am using Excel VBA, I have an error when I assign Vietnamese-Unicode character values in variable or MsgBox, like this:

Range("A1").Value = "Nguyễn Văn Bình"
MsgBox(Sheet5.Range("a453").Value

It results with: Nguy?n V?n B?nh

Is there a way to work around this?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Andiana
  • 1,912
  • 5
  • 37
  • 73
  • Typically, the `?` means that the OS doesn't support that character. Do these characters display correctly in the code before you run the sub? For example, if I copy the string to my editor I immediately get question marks because I don't have this font loaded on my machine; – Automate This Oct 19 '14 at 15:18
  • Avoid using MsgBox(), it came from the previous century and pretends that Unicode doesn't exist. Otherwise a bit odd to have your operating system's default code page configured wrong like that. Might be a specific Vietnamese problem, I'm guessing that [this page](http://www.bluesofts.net/Baiviet/Laptrinh/VB_VBA/MsgBoxUnicode.htm) is more readable to me than to you. The bad encoding in the web page is not encouraging :) – Hans Passant Oct 19 '14 at 15:50
  • 1
    A try In Control Panel > Regional and language options> advanced tab to choose the native language you want to use for non-unicode programs, maybe helps – anefeletos Oct 19 '14 at 15:57
  • Does this answer your question? [How do I display a messagebox with unicode characters in VBA?](https://stackoverflow.com/questions/55210315/how-do-i-display-a-messagebox-with-unicode-characters-in-vba) – user202729 Sep 29 '21 at 05:28

0 Answers0