VBA Check if variable is empty
问题 I have an object and within it I wanna check if some properties is set to false, like: If (not objresult.EOF) Then 'Some code End if But somehow, sometimes objresult.EOF is Empty , and how can I check it? IsEmpty function is for excel cells only objresult.EOF Is Nothing - return Empty objresult.EOF <> null - return Empty as well! 回答1: How you test depends on the Property's DataType: | Type | Test | Test2 | Numeric (Long, Integer, Double etc.) | If obj.Property = 0 Then | | Boolen (True/False)