|
请教高手:
max,min not等说我没有引用.......怎么解决?
Option Compare Database
Option Explicit
Public Function HNTQD(hntky1 As Double, hntky2 As Double, hntky3 As Double) As Double
Dim hntpj As Double
Dim hntmax As Double
Dim hntmin As Double
Dim hntzjz As Double
Dim qd41 As Double
Dim qd42 As Double
Dim qd43 As Double
qd41 = hntky1
qd42 = hntky2
qd43 = hntky3
hntmax = Max(qd41, qd42, qd43)
hntmin = Min(qd41, qd42, qd43)
hntpj = Avg(qd41, qd42, qd43)
hntzjz = Not (hntmax) And Not (hntmin)
If (hntmax - hntzjz) / hntzjz > 0.15 And (hntzjz - hntmin) / hntzjz > 0.15 Then
HNTQD = "作废"
ElseIf (hntmax - hntzjz) / hntzjz > 0.15 Or (hntzjz - hntmin) / hntzjz > 0.15 Then
HNTQD = hntzjz
ElseIf (hntmax - hntzjz) / hntzjz < 0.15 Or (hntzjz - hntmin) / hntzjz < 0.15 Then
HNTQD = hntpj
End If
End If
End If
End Function
|
|