参考:
Public Function aaa(text1, text2) As Double
On Error GoTo er
Dim a As Double, b As Double
If IsNumeric(text1) = True Then
a = CDbl(text1)
Else
MsgBox "第一个参数错误!"
Exit Function
End If
If IsNumeric(text2) = True Then
b = CDbl(text2)
Else
MsgBox "第二个参数错误!"
Exit Function
End If
Select Case a - b
Case 0
aaa = 0
Case Is <= 400
aaa = 400
Case Is > 400
aaa = a - b
End Select
Exit Function
er:
MsgBox Err.Description
End Function
我现在是在控件来源里写入:=IIf([水本月抄表]-[水上月抄表]<=400,400,[水本月抄表]-[水上月抄表]),但是[水本月抄表]-[水上月抄表]=0时,得出的结果是400,在控件来源如何写才能得出我需要的结果:等于0时结果为0,小于400且不等于0,结果为400,大于400按实际结果。谢谢老师教教我!
=IIf([水本月抄表]-[水上月抄表]=0,0,iif([水本月抄表]-[水上月抄表]<=400,400,[水本月抄表]-[水上月抄表]))
点击下载此附件
例如附件,假如可以最好在附件帮我修改。谢谢!
谢谢两位版主的帮助
总记录:5篇 页次:1/1 9 1 :