ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Visual Code to make sure value is greater than 0 (https://www.excelbanter.com/excel-discussion-misc-queries/246823-visual-code-make-sure-value-greater-than-0-a.html)

Jeremy

Visual Code to make sure value is greater than 0
 
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


jlclyde

Visual Code to make sure value is greater than 0
 
On Oct 28, 10:21*am, Jeremy wrote:
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

jlclyde

Visual Code to make sure value is greater than 0
 
On Oct 28, 10:21*am, Jeremy wrote:
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

Eduardo

Visual Code to make sure value is greater than 0
 
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


"Jeremy" wrote:

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


Jeremy

Visual Code to make sure value is greater than 0
 
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.


"Eduardo" wrote:

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


"Jeremy" wrote:

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



All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com