Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using VBA: Conditional Formatting of Row Color
I found the below script in one of the threads. It works fine except for one
thing. When you delete the contents of a cell, then the color does not revert to No Fill. Can anyone help? Thanks. I tried adding this but it didn't work. Case "" Target.EntireRow.Interior.ColorIndex = 0 Private Sub Worksheet_Change(ByVal Target As Range) Dim WatchRange As Range Dim CellVal As String If Target.Cells.Count 1 Then Exit Sub If Target = "" Then Exit Sub CellVal = Target Set WatchRange = Range("A1:c100") 'change to suit If Not Intersect(Target, WatchRange) Is Nothing Then Select Case CellVal Case "Dog" Target.EntireRow.Interior.ColorIndex = 5 Case "Cat" Target.EntireRow.Interior.ColorIndex = 10 Case "Other" Target.EntireRow.Interior.ColorIndex = 6 Case "Rabbit" Target.EntireRow.Interior.ColorIndex = 46 Case "Goat" Target.EntireRow.Interior.ColorIndex = 45 End Select End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for tab color | Excel Worksheet Functions | |||
Conditional Formatting on Color | Excel Worksheet Functions | |||
Color Conditional Formatting | Excel Worksheet Functions | |||
Conditional color formatting entries have wild color. | Excel Discussion (Misc queries) | |||
See conditional formatting Color value in vba | Excel Programming |