empty cell?

  • Thread starter Thread starter Lawson
  • Start date Start date
L

Lawson

how come blank cells have a value of greater than 0???

i have a simple formula:

If Range("b10") > 0 Then Range("h31") = 1

b10 is blank, yet is still sets h31 = 1

how do i get around this???
 
B10 may contain a space character, so it looks empty, but isn't.
Select cell B10, and press the Delete key, and that may fix the problem.
 
Hi Lawson,

Your observed result is consistent with B10 containing a formula which
returns "". It is not consistent with B10 being empty.

To deal with the first scenario, try:

If IsNumeric(Range("B10").Value) And Range("B10") > 0 _
Then Range("H31") = 1
 

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