# Hex Function

αααα‘ααβααααβα’ααααβαα½α αααβααααΆαβα²ααβαααααβαααβαααβααααΆαβαα½αβααβαααα½αβαα½αΒ α

## ααΆαααβααααααα α

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

## αααααβαααα‘αα α

ααααβα’αααα

## αααΆαααΆαααααα α

αααα½α α ααααααβαααβαα½αβαααα½α αααβα’αααβαααβααααααβααβααΆβαααα½αβαααβαααβααααΆαβαα½αΒ α

### Error codes:

5 ααΆαβα αβαααααβαα·αβααααΉαααααΌα

## α§ααΆα ααα α

``````
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
``````