#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hex2dec

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),
  #2   Report Post  
Posted to microsoft.public.excel.programming
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),

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hex2dec twilkers Excel Discussion (Misc queries) 2 August 17th 09 07:15 PM
How do I 'Add-In' Hex2Dec formula? Hex2Dec....Help! Excel Worksheet Functions 2 October 19th 06 04:49 PM
Hex2Dec substitue? Stuart Peters Excel Discussion (Misc queries) 1 July 29th 06 07:44 AM
conditional format with hex2dec laura_in_abq Excel Programming 2 September 27th 05 05:09 AM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"