ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA - Hex To ASCII (https://www.excelbanter.com/excel-programming/362027-vba-hex-ascii.html)

ajocius[_58_]

VBA - Hex To ASCII
 

Group,
Is there a function in VBA that will convert hex into ascii.
Example assume I have 0x39 and I want it to convert it to ascii, or 9.
Same goes for the alpha characters as well A thru Z both lower case and
upper case.

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=544141


C01d[_3_]

VBA - Hex To ASCII
 

Excel provides the Char(value) function, where value is the decima
representation of the ASCII character. The function returns the ASCI
character represented by the number.

Note that before using this function, your code will have to conver
the hexadecimal value to decimal first

--
C01
-----------------------------------------------------------------------
C01d's Profile: http://www.excelforum.com/member.php...fo&userid=3442
View this thread: http://www.excelforum.com/showthread.php?threadid=54414


AA2e72E

VBA - Hex To ASCII
 
Try:

Chr(Clng("&H" &yourHEXstring))



Tom Ogilvy

VBA - Hex To ASCII
 
? chr(&H39)
9

--
Regards,
Tom Ogilvy


"ajocius" wrote:


Group,
Is there a function in VBA that will convert hex into ascii.
Example assume I have 0x39 and I want it to convert it to ascii, or 9.
Same goes for the alpha characters as well A thru Z both lower case and
upper case.

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=544141




All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com