PDA

View Full Version : [SOLVED] Trouble with conditional format for entire column



template_girl
10-18-2004, 12:53 PM
I'm unable to enter a conditional format as part of a Macro. Row H contains multiple data. The desired result of the conditional formating should be that if a cell contains either C,EB,O,P,or VB the cell color will be red.

I entered Formula is =IF(OR(H="C",H="EB",H="O",H="P",H="VB"),1,0) but it's not working. Please help.

CBrine
10-18-2004, 01:19 PM
Try changing this

=IF(OR(H="C",H="EB",H="O",H="P",H="VB"),1,0)
to this

=IF(OR(H2="C",H2="EB",H2="O",H2="P",H2="VB"),1,0)

or change H2 to whatever the first cell of the selected range is.

The conditional formatting is smart enough to increment the H2 to H3, H4, etc...

Zack Barresse
10-18-2004, 01:28 PM
Hi, welcome to the board!!

If you select the H1, then press Ctrl + Spacebar (select entire column, ensuring H1 has the initial focus), go to conditional formatting, Formula Is ...


=(H1="C")+(H1="EB")+(H1="O")+(H1="P")+(H1="VB")

Make sure the references are relative and not absolute (absolute will have the Dollar signs { $ } preceeding the reference row and/or column).

Edit: Don't take a break before posting. LOL!

TonyJollans
10-18-2004, 03:30 PM
Hi template_girl,

Welcome to VBAX!

firefytr's solution is good, or ..

..sticking with your original format the IF is implicit in the situation and you do not need to specify it - it is enough to say ..

=OR(H1="C",H1="EB",H1=O",H1="P",H1="VB")

Zack Barresse
12-07-2004, 04:16 PM
Hi template_girl,


Did any of these help you out? If so, we can mark this thread Solved. :)