【发布时间】:2014-04-16 15:27:32
【问题描述】:
我有一段简单的 vba 代码,我希望它返回“必须条件二”,但它却一直下降到“三”。为什么?
Dim testValue as String
testValue = Null
If testValue = 8888 Then
Debug.Print "Got to condition one"
ElseIf testValue = Null Then
Debug.Print "Got to condition two"
Else
Debug.Print "Got to condition three"
End If
【问题讨论】:
-
第二行出现错误,
Null的使用无效(您不能将其分配给字符串。 -
使用
IsNull来检查Null -
Textbox null problem的可能重复