• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

char(number)

Hi !   Two ways :


      - By a formula in a cell.

        For example, the cell is F5 and you want the code of the fourth character :

Code:
          =CODE(MID($F$5,4,1)) 


      - By a VBA code :

[pre]Sub CellCharCodes()
S = ActiveCell

For N = 1 To Len(S)
C = Mid(S, N, 1)
T = T & Format(N, "@@  :   ") & C & Format(Asc(C), "   @@@") & vbLf
Next

MsgBox T
End Sub
[/pre]
        Select first the cell in the worksheet and after execute the sub …
 
Back
Top