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.
User ChrW() instead of Chr() function to reference Unicode characters:
ChrW(23383) will produce 字.
Chr(23383) will throw an exception.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With