# Hex Function

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

## แกแแแขแแฅแกแ

``````
Hex (Number)
``````

## แแแแ แฃแแแแฃแแ แแแแจแแแแแแแ:

แกแขแ แแฅแแแแแ

## Parameters:

แขแแฅแกแขแ: แแฅแแแแแแแก แ แแแแฅแขแแ แแแแกแแแแก แกแแกแฃแ แแแแ แแแแแกแแแแ แ แขแแฅแกแขแฃแ แ แแแแแกแแฎแฃแแแแ.

## แแแแแแแแ:

``````
Sub ExampleHex
' uses BasicFormulas in LibreOffice Calc
Dim a2, b2, c2 As String
a2 = "&H3E8"
b2 = Hex2Lng(a2)
MsgBox b2
c2 = Lng2Hex(b2)
MsgBox c2
End Sub

Function Hex2Lng(sHex As String) As Long
' Returns a 32-bit signed integer number from an 8-digit hexadecimal value.
Hex2Lng = clng( sHex )
End Function

Function Lng2Hex(iLong As Long) As String
' Calculates the 8-digit hexadecimal value out of a 32-bit signed integer number.
Lng2Hex = "&H" & Hex( iLong )
End Function
``````