CodeItBetter Programming Another VB Programming Blog

How to convert Hex to String

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
'String Manipulation - How to convert Hex to String
'Converts Hex to Sting (Useful for Encryption/Registry)

Option Explicit
 
Public Function HexToString(ByVal strData As String) As String
    Dim sResult As String
    Do Until Len(strData) < 2
        sResult = sResult & ChrW$(CLng("&H" & Left$(strData, 2)))
        strData = Right$(strData, Len(strData) - 2)
    Loop
    HexToString = sResult
End Function
Comments (1) Trackbacks (0)
  1. Simple and excellent function. Many, many thanks!


Leave a comment


 

No trackbacks yet.