Conditional Formatting Cells

T

tgorrie

I need help with conditional formatting.

A B
40 QTD Actual $3,654,317
41 Qtr. Objective $6,332,604
42 % Attainment QTD 57.7%
43 QTD Par % 53.8%


I'm not sure how to code this.

Cell be B43 varies as the monthly sales increase, Cell A40

Condition 1: Formula Is: If cell B42 is greater then B43 change B42 to
green. I understand how to fromat the color.

Condition 2: Formula Is: If cell B42 is between .01% and 5% of B43.
Change B42 to yellow.

Condition 3: Formula Is: If cell B42 is less then 5% of B43. Change B42
to Red.

Thanks for your help and input.
 
T

Tim Barlow

Try something like:

If Range("B42") >= Range("B43") Then
Range("B42").Font.Color = vbGreen
ElseIf Range("B42") >= Range("B43") - 0.05 Then
Range("B42").Font.Color = vbYellow
Else
Range("B42").Font.Color = vbRed
End If

HTH

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top