View Single Post
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
[email protected] temp@temp.com is offline
external usenet poster
 
Posts: 5
Default How to get different base systems so letters will show up like hex system tia sal2


Greetings all
I now to I can convert between different base systems using the code
Function baseconv(InputNum, BaseNum)
Dim quotient, remainder As Single
Dim answer As String

quotient = InputNum ' Set quotient to number to convert.
remainder = InputNum ' Set remainder to number to convert.
answer = ""

Do While quotient < 0 ' Loop while quotient is not zero.

' Store the remainder of the quotient divided by base number in a
' variable called remainder.

remainder = quotient Mod BaseNum

' Reset quotient variable to the integer value of the quotient
' divided by base number.

quotient = Int(quotient / BaseNum)

' Reset answer to contain remainder and the previous answer.
answer = remainder & answer
' Convert answer variable to a number.
Loop
baseconv = Val(answer)
End Function

but how can I get letters to show up in bases like 25 or 40?
Like in the Hex system.

Thanks
SAL2