Excel VBA copy to NP++ dword is garbled, vice versa
-
When I try to copy the excel built-in VBA code to notepad++, the dword text (my text is traditional Chinese) becomes garbled.
When notepad++ shows the correct dword copy to excel VB, the text becomes garbled.
how to let the chinese text as correct text, not garbled text.thanks
-
Can you provide a screenshot of what you see?
-
According to Microsoft support forum, the VBA editor does not accept Unicode characters.
When I typed “Hello, World” into Google Translate, I got:
I copy/pasted the “Chinese (Traditional)” results “你好世界。” into the Excel VBA editor, I just get:
Sub lookeehere() a = "?????" End Sub
(Reading that MS forum post suggests to me that maybe you are getting the characters from Excel itself, not from the VBA editor like your question implies. Or maybe you’re in the debugger, and grabbed a value from the local watch window, rather than from the VBA editor itself; I haven’t tried to see if that works.)
If I paste that same text from Google Translate into a cell in Excel, I see what I expect:
If I re-copy that cell from Excel and paste it into Notepad++:
你好世界。
the glyphs show up just like they did in Google Translate:
So, I could not replicate the exact circumstances of your problem statement, which doesn’t seem to match the capabilities of VBA editor; and when I replicated the only meaningful alternative I could think of, Notepad++ worked exactly as expected.
Things that you can check on your end:
- Does your selected font have those Chinese (Traditional) glyphs available? (Settings > Style Configurator > Global Styles > Default Style > Font Style > Font Name, and compare that to the Windows Run >
charmap.exe
, select the font , and make sure that it has the glyphs you are trying to work with) - Maybe try toggling Settings > Preferences > MISC > Use DirectWrite : having that checkmarked/on often helps users who are having trouble displaying the more complicated Unicode glyphs. (If it was off and you checkmark it, you will have to restart Notepad++ for it to take effect.)
- Does your selected font have those Chinese (Traditional) glyphs available? (Settings > Style Configurator > Global Styles > Default Style > Font Style > Font Name, and compare that to the Windows Run >
-
-
-
thanks your help for the deltail.
copy the raw data from exvel VBA or notepad++ copy and paste into excel vba are same problems.I will try to via MS notepad to notepad++ to solve this problem.
thanks