Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function CountColour(Rng As Range, ColourMatch As Integer, BackgroundOrFont As String)
[color green]'Rng is the set of cells to be checked
'ColurMatch is the Color INDEX of the colour being tested for
'BackgroundOrFont requires an "F" or "B" to indicate whether to test [b]F[/b]ont or [b]B[/b]ackground colour[/color]
Dim c As Range, TempStore As Long
TempStore = 0
Select Case BackgroundOrFont
Case "B"
For Each c In Rng
If c.Interior.ColorIndex = ColourMatch Then
TempStore = TempStore + 1
End If
Next
Case "F"
For Each c In Rng
If c.Font.ColorIndex = ColourMatch Then
TempStore = TempStore + 1
End If
Next
Case Else
CountColour = "Choose F or B only"
Exit Function
End Select
CountColour = TempStore
End Function
Sub List_Color_Indexes()
For i = 1 To 56
Activesheet.Cells(i, 1).Interior.ColorIndex = i
Next i
End Sub