我的msn: myfend@
Public Function Dec(TempStr As String) As Long
Dim TempData As String
Dim TempLen As Integer
Dim TempM As String
Dim TempData1 As Long
Dim Loopi As Long
Dim Loopj As Long
On Error GoTo OUT:
TempLen = Len(TempStr)
For Loopi = 1 To TempLen
TempM = Mid(TempStr, Loopi, 1)
Select Case UCase(TempM)
Case "A"
TempM = 10
Case "B"
TempM = 11
Case "C"
TempM = 12
Case "D"
TempM = 13
Case "E"
TempM = 14
Case "F"
TempM = 15
End Select
Loopj = TempLen
Loopj = Loopj - Loopi
TempData1 = TempData1 + CLng(TempM) * 16 ^ Loopj
Next
Dec = TempData1
Exit Function
OUT:
End Function