Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Code hidden Dennis Excel Discussion (Misc queries) 2 October 22nd 08 07:14 AM
repeating code in visual basic tobypitblado Excel Discussion (Misc queries) 4 September 17th 08 11:55 AM
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
How do I protect Visual Basic for Application Code Zagrijs Venter New Users to Excel 6 August 5th 05 09:24 PM


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"