Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Reference Special Characters Using Excel vba

Tags:

vba

I have several special characters in an excel spreadsheet. How do I reference them in Excel VBA?

The characters I need are not in the standard 255 ASCII codes.

I was thinking perhaps Chr(code) would work, but I'm not able to find the codes for the characters I need to test this.

like image 598
parap Avatar asked Aug 15 '26 02:08

parap


2 Answers

User ChrW() instead of Chr() function to reference Unicode characters:

ChrW(23383) will produce .

Chr(23383) will throw an exception.

like image 170
ttaaoossuuuu Avatar answered Aug 16 '26 15:08

ttaaoossuuuu


Use this script to see ChrW characters in F column

Sub caracter()
Dim caract As String
Dim r As Range
Dim i As Integer
caract = ChrW(633)
For i = 1 To 20000
caract = ChrW(i)
ActiveSheet.Cells(i, 6).Value = caract
Next i
End Sub
like image 34
Teodora Avatar answered Aug 16 '26 16:08

Teodora



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!