Skip to content

Instantly share code, notes, and snippets.

@bash0C7
Created January 2, 2012 00:28
Show Gist options
  • Save bash0C7/1548791 to your computer and use it in GitHub Desktop.
Save bash0C7/1548791 to your computer and use it in GitHub Desktop.
num↔hex functions
Public Function convNUMtoHEX(Number As Long) As String
convNUMtoHEX = CStr(Hex(Number))
End Function
Public Function convHEXtoNUM(HexString As String) As Long
Const HEXMARK = "&H"
Const UNSIGN = "&"
convHEXtoNUM = Val(HEXMARK & HexString & UNSIGN)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment