VBAmacrosExcel:如何从Excel单元格中读取Unicode字符

我正努力从VBA Excel中的单元格读取Unicode字符。

Sub mySub() Cells(1, "A").Value = ChrW(10003) ' Writes checkbox symbol to A1 MsgBox Asc(Cells(1, "A").Value) ' Output: 63 (questionmark symbol) ' Expected Output: 10003 End Sub 

如果checkbox符号被用户修改,我需要阅读Unicode字符才能看到。 我不知道如何比较Unicode字符与单元格值..

有时你需要的只是第二双眼睛。 🙂

 Sub mySub() Cells(1, "A").Value = ChrW(10004) ' Writes checkbox symbol to A1 'MsgBox Asc(Cells(1, "A").Value) ' Output: 63 (questionmark symbol) ' Expected Output: 10003 '/ Works! MsgBox AscW(Cells(1, "A").Value2) 'Almost there. Use AscW instead of Asc End Sub