Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Option Explicit
Public Function HexToDec(Hex As String) As Double
Dim i As Long
Dim j As Variant
Dim k As Long
Dim n As Long
Dim HexArray() As Double
n = Len(Hex)
k = -1
ReDim HexArray(1 To n)
For i = n To 1 Step -1
j = Mid(Hex, i, 1)
k = k + 1
Select Case j
Case 0 To 9
HexArray(i) = j * 16 ^ (k)
Case Is = "A"
HexArray(i) = 10 * 16 ^ (k)
Case Is = "B"
HexArray(i) = 11 * 16 ^ (k)
Case Is = "C"
HexArray(i) = 12 * 16 ^ (k)
Case Is = "D"
HexArray(i) = 13 * 16 ^ (k)
Case Is = "E"
HexArray(i) = 14 * 16 ^ (k)
Case Is = "F"
HexArray(i) = 15 * 16 ^ (k)
End Select
Next i
HexToDec = Application.WorksheetFunction.Sum(HexArray)
End Function
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Desktop in File-open on Excel | 7 | 35 | |
Vba code to spell check an excel document in a set range | 9 | 31 | |
Excel printing an invoice header over two sheets | 3 | 31 | |
Script/Formula to move data to another cell | 6 | 23 |
Join the community of 500,000 technology professionals and ask your questions.