Macro Help [Closed]

Report
-
Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
-
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 reply

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
797
try this (for all similar statements)


Cell.entirerow.Interior.ColorIndex = 3

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!