简体   繁体   中英

Excel VBA: chr-function error when using value > 255

I'm trying to print the lambda (λ) character using following code:

depug.print chr(964)

I looked up the specific value for lambda for the chr-function here . Unfortunately I get a Runtime-Error 5 with the information that it is an invalid value.

I found out this seems to appear using values over 255.

Now I am curious , how to print that lambda character? Respectively any other greek character?

You should be able to use

 ActiveCell.Value = ChrW(&H3BB)

credit: https://www.w3.org/Math/characters/html/symbol.html just replace 00 with &H

This thread also shows a link to a unicode converter Special characters(letters) in excel VBA (čćžšđ)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM