garbled codes in VBA

yxz152830

Active Member
Joined
Oct 6, 2021
Messages
390
Office Version
  1. 365
Platform
  1. Windows
gurus,
this is something that I got from some learning materials. Below is part of the code and it shows some weird characters.
I know little of UTF-8 or unicode or other language standardization systems. Could anyone tell me what to do next? Thanks!

VBA Code:
 Dim arr, wb As Workbook, key, dz, dzz
 Dim lngLastRow As Long
 Dim rng As Range
 dzz = Cells(4, 12)
 key = InputBox("ÇëÊäÈëÎļþÃû£¨ÀýÈ磺ÈÕÆÚ+Åú´Î£©", "TNT DMSÊý¾Ýµ¼³ö", "¹ãÖÝ")
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The Visual Basic Editor does not support Unicode characters. However, as a workaround, you can enter your text in a worksheet cell in Excel, and then you can refer to that cell for the text. Note that you'll need to use the InputBox method of the Application object, instead of the InputBox function, like this . . .

VBA Code:
key = Application.InputBox(Range("A1").Value)

Hope this helps!
 
Upvote 0
is there any patch that I can install? If someone wrote the code then he probably didnt see any garbled characters or letters.
The Visual Basic Editor does not support Unicode characters. However, as a workaround, you can enter your text in a worksheet cell in Excel, and then you can refer to that cell for the text. Note that you'll need to use the InputBox method of the Application object, instead of the InputBox function, like this . . .

VBA Code:
key = Application.InputBox(Range("A1").Value)

Hope this helps!
 
Upvote 0
Sorry, I'm not aware of one.
what is the reason behind this? Why could someone write such codes? Apparently he was writing them in normal typing and when i downloaded the file the letters are all of a sudden unrecognizable?
 
Upvote 0
I'd imagine it's to do with the language installation of your version of Windows.
 
Upvote 0

Forum statistics

Threads
1,214,528
Messages
6,120,065
Members
448,942
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top