Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hex to Dec and Oct to Dec..... 1

Status
Not open for further replies.

flaniganmj

Technical User
Jun 25, 2002
81
US
Howdy,

Is there a built in function, or even an add-in, to allow me to convert hexadecimal to decimal, i.e. 5F to 95? I also need to convert Oct to Dec. Any help is greatly appriciated.

flan
 
Hi flanpk,

There are functions which I think are a standard part of VBA to do all this ..

Hex(number) converts a number to hexadecimal
Oct(number) converts a number to octal
CDec(number) converts a number to decimal

In all the above, number can be
- a decimal number
- a hex literal given as &H followed by a hex number
- an octal literal given as &O followed by an octal number
- a String which translates as one of the above

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top