Not great with code myself but give this a try
Amended
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Rng As Range
Set Rng = Range("A1:A10")
If CountByColor(Rng, 3, True) >= 1 And _
WorksheetFunction.CountA(Rng) >= 1 Then
ActiveWorkbook.ActiveSheet.Tab.ColorIndex = 3
Else
Rng.Font.ColorIndex = 0
ActiveWorkbook.ActiveSheet.Tab.ColorIndex = xlNone
End If
End Sub
Sorry
Code in normal module to count font colour from Chip pearson site
Function CountByColor(InRange As Range, _
WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Long
'
' This function return the number of cells in InRange with
' a background color, or if OfText is True a font color,
' equal to WhatColorIndex.
'
Dim Rng As Range
Application.Volatile True
For Each Rng In InRange.Cells
If OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CountByColor = CountByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
Next Rng
End Function
VBA Noob
Bookmarks