Conditional format if difference in cell values greater than 0.50%

  • Thread starter Thread starter Sabosis
  • Start date Start date
S

Sabosis

Hello-

I am trying to conditionally format a call using VBA if the value of the cell is equal to or greater than 0.50% based on another cell.

if cell b2 = 2.50%
and cell c2 = 1.85%
then I would want b2 highlighted red as the increase amount is over .50.

Thanks

Scott
 
Sabosis said:
I am trying to conditionally format a call using VBA if the value of the
cell is equal to or greater than 0.50% based on another cell.

if cell b2 = 2.50%
and cell c2 = 1.85%
then I would want b2 highlighted red as the increase amount is over .50.

Depends on what you mean by "highlighted". If you mean "the cell gets filled
with red", use this:

If (Range("B2").Value - Range("C2").Value) > 0.005 Then
Range("B2").Interior.Color = vbRed
End If

If you mean "the text is turned red", use this:

If (Range("B2").Value - Range("C2").Value) > 0.005 Then
Range("B2").Font.Color = vbRed
End If

If you mean *anything else*, please clarify.
 
Back
Top