1

I am struggling to read a Unicode character back from a cell in VBA Excel.

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

I need to read the Unicode character to see, if the checkbox symbol was modified by a user. I have no Idea how to compare a Unicode character with the cells value..

1 Answer 1

3

Sometimes all you need is second pair of eyes. :)

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.