IsEmpty() Returns False in empty cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Occasionally when I use IsEmpty to see if a cell contains data like
"IsEmpty(Cells(x,y))" it returns "False" when there is nothing there. I've
tested the cell with Len(Cells(x,y)) and it returns 0. Does anyone know why
this happens or how to get around it?
Thanks,
John Hutchins
 
It can contain a zero length string. This can be cause when you do a Paste
Special, Value when the cell contained a formula displaying ""

=if(true,"",false)

as an example.
 
IsEmpty(), while it seems to work for really empty cells, is meant to
determine if a variable has been initialized.

You may be better off testing as follows if you want cells with formulas
that return null strings to be considered empty:

?Cells(1, 1) = ""
False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top