- Home
·
- Math/Dates
·
- Convert Hex value to decimal equilivant. Great for color functions.
Convert Hex value to decimal equilivant. Great for color functions.
Convert Hex value to decimal equilivant. Great for color functions.
Rate Convert Hex value to decimal equilivant. Great for color functions.
(2(2 Vote))
Dim LC As Long
Dim curHexValue As String
Dim curChar As String
Dim curValue As String
curHexValue = UCase(Trim(paraHexValue))
If Left(curHexValue, 2) = "&H" Then curHexValue = Mid(curHexValue, 3)
For LC = 1 To Len(curHexValue)
curChar = Mid(curHexValue, LC, 1)
If InStr(1, "ABCDEF", curChar) <> 0 Then curChar = Asc(curChar) - 55
curValue = Val(curValue) + (Val(curChar) * (16 ^ (Len(curHexValue) - LC)))
Next LC
Hex2Dec = Val(curValue)
End Function
Convert Hex value to decimal equilivant. Great for color functions. Comments
No comments yet — be the first to post one!
Post a Comment