如何将null做为参数传递给自定义函数
Public Function yesToOne(stra As String)
If IsNull(stra) Then
yesToOne = 0
Else
If stra = "是" Then
yesToOne = 1
Else
yesToOne = 0
End If
End If
End Function
如果传入的参数为空,就会出错.这个怎么改?谢谢.
[解决办法]
Public Function yesToOne(stra As variant)
If IsNull(stra) Then
yesToOne = 0
Else
If stra = "是" Then
yesToOne = 1
Else
yesToOne = 0
End If
End If
End Function