If statement help

HYKE

Active Member
Joined
Jan 31, 2010
Messages
373
Hi,

I am trying to do this in conditional format but is unsuccessful. Any other was to do this?

If cell A1>0 then range A1:AB1 .fontcolorindex is red
cell B1>0 then range A1:AB1 .fontcolorindex is orange
cell C1>0 then range A1:AB1 .fontcolorindex is green
this goes down the column.

Any help is much appreciated...
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi Jim May,

What I am actually entering in the cells A1,B1 and C1 is date. To change what I want to really happen

If A1="" then range A1:AB1.fontcolorindex=red
If A1>0(or has data/date) and B1="" and C1="" then A1:B1.fontcolorindex=orange
If A1>0(or has data/date) and B1>0(or has data/date) and C1>0(or has data/date) then A1:B1.fontcolorindex=green

Thanks for your help..

HYKE
 
Upvote 0
Which version of excel are you using? Are you trying to do this in VBA?
 
Upvote 0
Try applying the CF rules as below

Note that they must be in the correct order

<TABLE style="BORDER-BOTTOM-STYLE: groove; BORDER-BOTTOM-COLOR: #ff0000; BORDER-RIGHT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-TOP-COLOR: #ff0000; FONT-FAMILY: Arial; BORDER-TOP-STYLE: groove; BORDER-RIGHT-COLOR: #ff0000; FONT-SIZE: 10pt; BORDER-LEFT-STYLE: groove; BORDER-LEFT-COLOR: #ff0000"><TBODY><TR><TD>Conditional formatting </TD></TR><TR><TD><TABLE style="PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Arial; FONT-SIZE: 10pt" border=1 cellSpacing=0 cellPadding=0><TBODY><TR><TD>Cell</TD><TD>Nr.: / Condition</TD><TD>Format</TD></TR><TR><TD>A1:AB1</TD><TD>1. / Formula is =ISNUMBER($C1)</TD><TD style="BACKGROUND-COLOR: #00b050">Abc</TD></TR><TR><TD>A1:AB1</TD><TD>2. / Formula is =ISNUMBER($B1)</TD><TD style="BACKGROUND-COLOR: #ffc000">Abc</TD></TR><TR><TD>A1:AB1</TD><TD>3. / Formula is =ISNUMBER($A1)</TD><TD style="BACKGROUND-COLOR: #ff0000">Abc</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1
 
Upvote 0
Hi Jason/JimMay,

I am still using version 2003 of excel. Also Jason,I tried your conditional format, it did not work for me. Can this be done thru VBA?


If so, kindly provide..

Thanks,

HYKE
 
Upvote 0
The conditional format should work with 2003, what happened when you tried it?
 
Upvote 0
I've never tried sending an Image, pardon the test.. But In xl 2007 (all I now have) this worked...

 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top