Hex Function

āĻāĻ•āĻŸāĻŋ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžāĻ° āĻšā§‡āĻ•ā§āĻ¸āĻžāĻĄā§‡āĻ¸āĻŋāĻŽāĻžāĻ˛ āĻŽāĻžāĻ¨ āĻ¨āĻŋāĻ°ā§āĻĻā§‡āĻļāĻ• āĻ¸ā§āĻŸā§āĻ°āĻŋāĻ‚ āĻĒā§āĻ°āĻĻāĻžāĻ¨ āĻ•āĻ°ā§‡ āĻĨāĻžāĻ•ā§‡āĨ¤

āĻ¸āĻŋāĻ¨āĻŸā§āĻ¯āĻžāĻ•ā§āĻ¸:


Hex (Number)

āĻĒā§āĻ°āĻĻāĻžāĻ¨ āĻŽāĻžāĻ¨:

āĻ¸ā§āĻŸā§āĻ°āĻŋāĻ‚

āĻĒā§āĻ¯āĻžāĻ°āĻžāĻŽāĻŋāĻŸāĻžāĻ°:

āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž: āĻ¯ā§‡āĻ•ā§‹āĻ¨ā§‹ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžāĻ¸ā§‚āĻšāĻ• āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨ āĻ¯āĻž āĻ†āĻĒāĻ¨āĻŋ āĻšā§‡āĻ•ā§āĻ¸āĻžāĻĄā§‡āĻ¸āĻŋāĻŽāĻžāĻ˛ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžā§Ÿ āĻ°ā§‚āĻĒāĻžāĻ¨ā§āĻ¤āĻ° āĻ•āĻ°āĻ¤ā§‡ āĻšāĻžāĻ¨āĨ¤

Error codes:

5 Invalid procedure call

āĻ‰āĻĻāĻžāĻšāĻ°āĻŖ:


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

Please support us!