# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  character to integer conversion

## lithium81

Is there any way to convert a charatcer into its decimal value in excel VBA?

E.g. to compare "A" to the number 65 which is its decimal equivalent?

Thank you!

----------


## Norman Jones

Hi Lithium81,

MsgBox Asc("A")

---
Regards,
Norman



"lithium81" <lithium81.24e7qm_1141891801.073@excelforum-nospam.com> wrote in
message news:lithium81.24e7qm_1141891801.073@excelforum-nospam.com...
>
> Is there any way to convert a charatcer into its decimal value in excel
> VBA?
>
> E.g. to compare "A" to the number 65 which is its decimal equivalent?
>
> Thank you!
>
>
> --
> lithium81
> ------------------------------------------------------------------------
> lithium81's Profile:
> http://www.excelforum.com/member.php...o&userid=29461
> View this thread: http://www.excelforum.com/showthread...hreadid=520458
>

----------


## Toppers

A1="A"
in B1 put =Code(A1)

or  =Code("A")

"lithium81" wrote:

>
> Is there any way to convert a charatcer into its decimal value in excel
> VBA?
>
> E.g. to compare "A" to the number 65 which is its decimal equivalent?
>
> Thank you!
>
>
> --
> lithium81
> ------------------------------------------------------------------------
> lithium81's Profile: http://www.excelforum.com/member.php...o&userid=29461
> View this thread: http://www.excelforum.com/showthread...hreadid=520458
>
>

----------


## NickHK

lithium81,
If on a worksheet, check the CODE and CHAR functions in Excel Help
If in VBA, then it's ASC and CHR in VBA help.

NickHK

"lithium81" <lithium81.24e7qm_1141891801.073@excelforum-nospam.com> wrote in
message news:lithium81.24e7qm_1141891801.073@excelforum-nospam.com...
>
> Is there any way to convert a charatcer into its decimal value in excel
> VBA?
>
> E.g. to compare "A" to the number 65 which is its decimal equivalent?
>
> Thank you!
>
>
> --
> lithium81
> ------------------------------------------------------------------------
> lithium81's Profile:
http://www.excelforum.com/member.php...o&userid=29461
> View this thread: http://www.excelforum.com/showthread...hreadid=520458
>

----------


## lithium81

Thanks folks! That helps a lot!!

----------

