View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
XR8 Sprintless XR8 Sprintless is offline
external usenet poster
 
Posts: 19
Default Conditional formatting with vba

I am a relative newbie at VBA and need some help with this one.
I have developed a sheet where I want to conditionally format the font
colour in cells in a row if the cell contents equals the contents in
column a.

I also need it to not change if the cell value is one of two values in
cell a of the row and finally if the values in the row do not equal the
value in column a then format the font in a different colour.

I have rows from 3 to 210 however I am not able to specify how many
columns need to be checked as that will vary.

EG

Column A Column B Column c ...

1 Apples Bananas(red font) Apples(blue font) Pears(red font)
apples(blue font)
2 Peaches Peaches(blue font) Apples(red font) Pears (red font) Peaches
(blue font)
3 TBP(No font change)
4 Bye(No font change)
..
..
210

I am trying to get it to work as a worksheet change event,however keep
getting nowhere. Can anyone help.

My thoughts were along the lines of

For x = 3 to 210
Select Case
Case TBP
if A(x) = "TBP"
No font change

Case Bye
If A(x) = "Bye"
No font change

Case CellEqual
If B(x).End(xlRight) = A(x)
Change font colour to blue

Case cellnotequal
If B(x).End(xlRight) < A(x)
Change font colour to red

Next x

Can anyone help me to achieve this?