Formula as follows... i am not sure what is causing the error... sorry for breaking rule 3.
Sub COLOR()
Sub Worksheet_Chang e(ByVal Target As Excel.Range)
If Intersect(Targe t, Range("AH6:AH55 000")) Is Nothing Then
Exit Sub
Else
DidCellsChange
End If
End Sub
Sub DidCellsChange( )
Dim KeyCells As String
' Define which cells should trigger the KeyCellsChanged macro.
KeyCells = "AH6:AH5500 0"
' If the Activecell is one of the key cells, call the
' KeyCellsChanged macro.
If Not Application.Int ersect(ActiveCe ll, Range(KeyCells) ) _
Is Nothing Then KeyCellsChanged
End Sub
Sub KeyCellsChanged ()
Dim Cell As Object
For Each Cell In Range("AH6:AH55 000")
If Cell = "AH" Then
' Make the background color of the cell the 3rd color on the
' current palette.
ElseIf Cell = "DISCARD" Then
Cell.EntireRow. Interior.ColorI ndex = 3
ElseIf Cell = "" Then
' Otherwise, set the background to none (default).
Cell.EntireRow. Interior.ColorI ndex = xlNone
End If
Next Cell
End Sub
Sub COLOR()
Sub Worksheet_Chang e(ByVal Target As Excel.Range)
If Intersect(Targe t, Range("AH6:AH55 000")) Is Nothing Then
Exit Sub
Else
DidCellsChange
End If
End Sub
Sub DidCellsChange( )
Dim KeyCells As String
' Define which cells should trigger the KeyCellsChanged macro.
KeyCells = "AH6:AH5500 0"
' If the Activecell is one of the key cells, call the
' KeyCellsChanged macro.
If Not Application.Int ersect(ActiveCe ll, Range(KeyCells) ) _
Is Nothing Then KeyCellsChanged
End Sub
Sub KeyCellsChanged ()
Dim Cell As Object
For Each Cell In Range("AH6:AH55 000")
If Cell = "AH" Then
' Make the background color of the cell the 3rd color on the
' current palette.
ElseIf Cell = "DISCARD" Then
Cell.EntireRow. Interior.ColorI ndex = 3
ElseIf Cell = "" Then
' Otherwise, set the background to none (default).
Cell.EntireRow. Interior.ColorI ndex = xlNone
End If
Next Cell
End Sub
Comment