Visual Code to make sure value is greater than 0

J

Jeremy

I am trying to use a visual statement to make sure a value in an active cell
is greater than 0 and am not able to do it properly. This cell has a value
that comes from another cell. Below is the code I am looking at.

If ActiveCell.Address <> "0" Then

Thanks
 
J

jlclyde

I am trying to use a visual statement to make sure a value in an active cell
is greater than 0 and am not able to do it properly.  This cell has a value
that comes from another cell.  Below is the code I am looking at.

If ActiveCell.Address <> "0" Then

Thanks

Get rid of the quotes around 0 or use selection <> 0 or
selection.value <> "". All are options. It is best if you can refer
to the range instead of selcting a cell though. If Range("A2") <> ""
Then. This peeds up your code.

Jay
 
J

jlclyde

I am trying to use a visual statement to make sure a value in an active cell
is greater than 0 and am not able to do it properly.  This cell has a value
that comes from another cell.  Below is the code I am looking at.

If ActiveCell.Address <> "0" Then

Thanks

i forgot to add this part. ActiveCell.Address returns the cell
address like A2 B9 so forth. This woudl never be 0. You could use
ActiveCell.Value.

Jay
 
E

Eduardo

Hi,
you can use conditional formating to highlight the cell if the value is less
than 0, in excel 2007, home, conditional formating, Highlight cells rules,
Less than, choose 0 and then choose the color
 
J

Jeremy

I am not able to use conditional formating on what I am looking for. There
is more visual statement I am using to do what I am looking for. If the
value is 0 I don't want it to execute my next step in visual.
 
Top