Public Function UnHex(sHex As String) As Long UnHex = Val("&H" & sHex)End Function

Public Function DecToHexFull(strAsc) As String'this function will convert decimal (only decimal) to hex and the result will be in 00 00 00 00 format'maximal value which can be handled will be only 2147483647 strAsc = Hex(strAsc) If Len(strAsc) < 8 Then Do Until Len(strAsc) = 8 strAsc = "0" & strAsc Loop End If Dim lonLen As Long lonLen = Len(strAsc) Dim i As Integer For i = 1 To Len(strAsc) strAsc = strAsc & Mid(strAsc, i, 2) & " " i = i + 1 Next i DecToHexFull = Mid(strAsc, lonLen + 1) DecToHexFull = Mid(DecToHexFull, 1, Len(DecToHexFull) - 1)End Function