|
修改模块为:
Public Function MM(ByVal STR As String)
Dim AA, BB, CC, DD, EE
Dim QQ
If IsNull(STR) = True Or Len(STR) = 0 Then Exit Function
If Asc(Right(STR, 1)) = 34 Or Right(STR, 1) = "'" Then
If Asc(Right(STR, 1)) = 34 Then
QQ = 25.4
ElseIf Right(STR, 1) = "'" Then
QQ = 304
End If
AA = Left(STR, Len(STR) - 1)
BB = InStr(1, AA, "-")
If BB > 0 Then
CC = Left(AA, BB - 1)
DD = Mid(AA, BB + 1, 1)
EE = Mid(AA, BB + 3, 1)
MM = Format((CC + DD / EE) * QQ, "0.00")
Else
BB = InStr(1, AA, "/")
If BB > 0 Then
DD = Mid(AA, BB - 1, 1)
EE = Mid(AA, BB + 1, 1)
MM = Format((DD / EE) * QQ, "0.00")
Else
MM = Format(AA * QQ, "0.00")
End If
End If
ElseIf Right(STR, 2) = "mm" Then
MM = Format(Left(STR, Len(STR) - 2), "0.00")
Else
MM = STR
End If
End Function |
|