Hex Function

Returns a string that represents the hexadecimal value of a number.

āļšāˇāļģāļš āļģāˇ“āļ­āˇ’āļē:


Exp (Number)

āļ†āļ´āˇƒāˇ” āļŊāļļāˇāļ¯āˇ™āļą āļ…āļœāļē:

String

āļ´āļģāˇāļ¸āˇ’āļ­āˇ“āļąāˇŠ:

Number: āļ”āļļāļ§ āļ…āˇ‚āˇŠāļ§āļš āļ…āļœāļēāļšāļ§ āˇ„āˇāļģāˇ€āˇ“āļ¸āļ§ āļ…āˇ€āˇāˇŠâ€āļē āļ•āļąāˇ‘āļ¸ āˇƒāļ‚āļ›āˇŠâ€āļēāˇāļ­āˇŠāļ¸āļš āļ´āˇŠâ€āļģāļšāˇāˇāļąāļēāļšāˇŠ.

Error codes:

5 Invalid procedure call

āļ‹āļ¯āˇāˇ„āļģāļĢāļē:


Sub ExampleHex
' uses BasicFormulas in $[officename] Calc
Dim a2, b2, c2 As String
    a2 = "&H3E8"
    b2 = Hex2Int(a2)
    MsgBox b2
    c2 = Int2Hex(b2)
    MsgBox c2
End Sub
 
Function Hex2Int( sHex As String ) As Long
' Returns a long integer from a hexadecimal value.
    Hex2Int = clng( sHex )
End Function
 
Function Int2Hex( iLong As Long) As String
' Calculates a hexadecimal value in integer.
    Int2Hex = "&H" & Hex( iLong )
End Function

Please support us!