Refresh colour in conditional formating excel
Closed
confused
-
Aug 13, 2009 at 01:32 AM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Aug 15, 2009 at 11:31 PM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Aug 15, 2009 at 11:31 PM
Related:
- Refresh colour in conditional formating excel
- How to refresh outlook - Guide
- Facebook auto refresh - Guide
- Crimping colour code - Guide
- Marksheet format in excel - Guide
- Network refresh code - Guide
1 response
Excelguru
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Aug 15, 2009 at 11:31 PM
Aug 15, 2009 at 11:31 PM
Try this
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As String
If Target.Cells.Count > 1 Then Exit Sub
CellVal = Target
Set WatchRange = Range("A1:F7")
'If Not Intersect(Target, WatchRange) Is Nothing Then
For Each cll In WatchRange
Select Case cll.Value
Case "Pass"
cll.Interior.ColorIndex = 6
Case "Fail"
cll.Interior.ColorIndex = 7
Case "Block"
cll.Interior.ColorIndex = 5
Case "TBD"
cll.Interior.ColorIndex = 9
Case Else
cll.Interior.ColorIndex = 0
End Select
Next
'End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As String
If Target.Cells.Count > 1 Then Exit Sub
CellVal = Target
Set WatchRange = Range("A1:F7")
'If Not Intersect(Target, WatchRange) Is Nothing Then
For Each cll In WatchRange
Select Case cll.Value
Case "Pass"
cll.Interior.ColorIndex = 6
Case "Fail"
cll.Interior.ColorIndex = 7
Case "Block"
cll.Interior.ColorIndex = 5
Case "TBD"
cll.Interior.ColorIndex = 9
Case Else
cll.Interior.ColorIndex = 0
End Select
Next
'End If
End Sub