Funci贸 Hex

Torna una cadena que representa el valor hexadecimal d'un nombre.

Sintaxi:


Hex (Number)

Valor de retorn:

Cadena

Par脿metres:

Nombre: Qualsevol expressi贸 num猫rica que vulgueu convertir en un nombre hexadecimal.

Codis d'error

5 La crida al procediment no 茅s v脿lida

Exemple:


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

Ens cal la vostra ajuda!