Conditional format if difference in cell values greater than 0.50%

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
 
A

Auric__

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.
 

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