Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default convert hex-values to decimal values

hello everybody

i need a function to convert hex-values to deciaml-values (excel 2000)

example:
hex2dec("5A") - result: "90"


who can help me?
thanks
markus


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default convert hex-values to decimal values

http://www.experts-exchange.com/Appl..._20658588.html

On Thu, 28 Aug 2003 "Markus Früh" wrote:
i need a function to convert hex-values to deciaml-values (excel 2000)

example:
hex2dec("5A") - result: "90"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default convert hex-values to decimal values

hello

thanks for the link. but there is no help. they write about a function
called HEX2DEC() , but i do not have such a function? i have installed all
"add-ins" but my excel2000 (german) do not find this function?

has anybody an other solution?

thanks
markus


"Wild Bill" schrieb im Newsbeitrag
...
http://www.experts-exchange.com/Appl..._20658588.html




On Thu, 28 Aug 2003 "Markus Früh" wrote:
i need a function to convert hex-values to deciaml-values (excel 2000)

example:
hex2dec("5A") - result: "90"


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default convert hex-values to decimal values

Now that I look at it more closely I see a lot of noise there. Try the
code in routine Button1_Click there and see if you can adapt that logic.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default convert hex-values to decimal values


"Markus Früh" wrote in message
...
hello

thanks for the link. but there is no help. they write about a function
called HEX2DEC() , but i do not have such a function? i have installed all
"add-ins" but my excel2000 (german) do not find this function?


The inbuilt function is Hex(no)

Keith





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default convert hex-values to decimal values

http://www.aboutvb.de/khw/artikel/khwhextodec.htm no doubt :) Good.
I didn't realize that Val had that capability - but it's right there in
its help.

On Thu, 28 Aug 2003, "Markus Früh" wrote:
thanks bill

i have found the following code:

Public Function HexToDec(HexValue As String) As Long
On Error Resume Next
If UCase$(Left$(HexValue, 2)) = "0X" Then
HexToDec = Val("&H" & Mid$(HexValue, 3))
ElseIf UCase$(Left$(HexValue, 2)) < "&H" Then
HexToDec = Val("&H" & HexValue)
Else
HexToDec = Val(HexValue)
End If
End Function

with this, it runs!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default convert hex-values to decimal values

or clng, etc.

On Thu, 28 Aug 2003 10:22:34 +0100, "Keith Willshaw"
wrote:


"Markus Früh" wrote in message
...
hello

thanks for the link. but there is no help. they write about a function
called HEX2DEC() , but i do not have such a function? i have installed all
"add-ins" but my excel2000 (german) do not find this function?

has anybody an other solution?

thanks
markus



Sorry I misread your post

The function you need is

Variant=CDEC("String")

Where String is the hex number prefixed with &H

Thus

MsgBox CDec("&HC1A")

would output 3098

Keith


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
Net should be zero but it is not; decimal values aroung the 12 dec frecar Excel Worksheet Functions 11 January 23rd 09 12:23 AM
Decimal Values JimQ Excel Discussion (Misc queries) 1 May 23rd 08 07:00 AM
How do I convert decimal values to hours & minutes in Excel 2000? Bo0ts Excel Discussion (Misc queries) 6 August 3rd 07 12:27 AM
Hiding certain decimal values [email protected] Excel Worksheet Functions 4 June 11th 07 09:35 PM
How to convert decimal values (dd.dddddd) to degrees/minutes/seco. Florin Balcu Excel Worksheet Functions 2 November 12th 04 05:12 AM


All times are GMT +1. The time now is 07:59 AM.

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"