Macro Help

Closed
LostandConfused - Feb 14, 2012 at 12:25 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Feb 15, 2012 at 12:23 AM
Hello,

I am new to VB and Excel. I've got the following code:

<Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("B5:L59")
For Each Cell In MyPlage

If Cell.Value = "Contract Denied" Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = "Contract Accepted" Then
Cell.Interior.ColorIndex = 10
End If
If Cell.Value = "Contract Sent" Then
Cell.Interior.ColorIndex = 4
End If
If Cell.Value = "Pricing Convo" Then
Cell.Interior.ColorIndex = 45
End If
If Cell.Value = "Call Back" Then
Cell.Interior.ColorIndex = 7
End If
If Cell.Value = "Contact Made" Then
Cell.Interior.ColorIndex = 6

If Cell.Value <> "Contract Denied" And Cell.Value <> "Contract Accepted" And Cell.Value <> "Contract Sent" And Cell.Value <> "Pricing Convo" And Cell.Value <> "Call Back" And Cell.Value <> "Contact Made" Then
Cell.Interior.ColorIndex = xlNone
End If
End If
Next
End Sub>

I've got everything working fine, but need the entire row to change colors, not just the cell which contains the value ("Contract Sent", etc.)

Any help is very appreciated! Thanks.

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Feb 15, 2012 at 12:23 AM
try this (for all similar statements)


Cell.entirerow.Interior.ColorIndex = 3
0