Thread: hex2dec
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default hex2dec

This is a function I use for that:

Function Hex2Dec(strHex As String) As Long

'converts a hexadecimal number to a long
'if the prefix &H is not there, it will be added first
'-----------------------------------------------------

On Error GoTo ERROROUT

If Left$(strHex, 2) = "&H" Then
Hex2Dec = CLng(Val(strHex))
Else
Hex2Dec = CLng(Val("&H" & strHex))
End If

Exit Function
ERROROUT:

MsgBox "CAN'T HANDLE THE STRING: " & strHex, , "Hex2Dec"

End Function

You could then do:
MsgBox Hex2Dec(Mid$("FFFB: 00FFB125148", 7, 8))


RBS



"jgreen" <u19247@uwe wrote in message news:5c9ed809cbdcb@uwe...
I would like to know how to convert a hex2dec string value in excel 2003

ex of string value: FFFB: 00FFB125148

I only want to convert values starting at the 7th charactor ending at the
14th.(00FFB125),