I have used the following VBA code:
Do While .Cell(i,1) <> Empty
' doing things
i = i+1
Loop
to iterate through columns (with Double/Integer values) in Excel. Then I found a case where the test evaluates to False whenever the value of the cell is 0. I have no idea what the difference is between this case and the working ones.
If I change the test to:
Do While Not IsEmpty(.Cell(i,1))
..
Loop
it works fine. So my question is: What is the difference between how IsEmpty() and =Empty is evaluated? In what cases will =Empty evaluate to True for cells with value 0?
Range("A2")=0
?Range("A2")=Empty
True
?IsEmpty(range("A2"))
False
I'd like to see a case where a cell value of 0= Empty
returns False! – Jean-François Corbett