This is a macro I use, it has two options; as an application, you enter the character in a fixed cell and press the form button or the current selection is used in the other. Each code only works with one character or only the first character is returned. JSW
Sub myASC()
'This code block for a cell.
If IsEmpty([B6].Value) = True Then
MsgBox "The ""Box"" is: Empty!"
Else
MsgBox "The ""ASC"" code," & Chr(13) & "for the character" & _
Chr(13) & "you entered is: " & Chr(13) & Chr(13) & _
" " & Asc([B6].Value)
'This code block for a selection.
'If IsEmpty(ActiveCell.Value) = True Then
'MsgBox "The ""Box"" is: Empty!"
'Else
'MsgBox "The ""ASC"" code," & Chr(13) & "for the character" & _
'Chr(13) & "you entered is: " & Chr(13) & Chr(13) & _
'" " & ASC(ActiveCell.Value)
End If
End Sub
P.S. This code turns out to be the same as Ivan's.
This message was edited by Joe Was on 2002-09-06 12:54