View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Looking for excel function to convert hex to Ascii

Public Function Hex2ASCII(hexvalue)
Dim i As Long
Dim tmp

If TypeName(hexvalue) = "Range" Then
tmp = hexvalue.Value
ElseIf TypeName(hexvalue) = "String" Then
tmp = hexvalue
Else
Hex2ASCII = CVErr(xlErrRef)
Exit Function
End If

For i = 1 - Len(tmp) Mod 2 To Len(tmp) Step 2
Hex2ASCII = Hex2ASCII & Chr(Mid(tmp, i, 2))
Next i

End Function


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"SuperUke" wrote in message
...
Trying import a hexidecimal file and convert to Ascii characters