Count cell by fill color and text color

Опубликовано: 27 Март 2026
на канале: Boost Excel
2,910
23

Here is a video tutorial on how to count cell by fill color and text color

🔸Subscribe to Excel Art
   / @excelart1017  

👇Code for COUNTFONTCOLOR Formula
Function COUNTFONTCOLOR(cell_range As Range, CellFont_color As Range) As Long
Dim FontColor As Long
Dim CurrentRange As Range
Dim FontRes As Long
Application.Volatile
FontRes = 0
FontColor = CellFont_color.Cells(1, 1).Font.Color
For Each CurrentRange In cell_range
If FontColor = CurrentRange.Font.Color Then
FontRes = FontRes + 1
End If
Next CurrentRange
COUNTFONTCOLOR = FontRes
End Function

👇Code for COUNTCOLOR Formula
Function COUNTCOLOR(CellRange As Range, CellColor As Range)
Dim FillColor As Integer
Dim FillTotal As Integer
FillColor = CellColor.Interior.ColorIndex
Set rCell = CellRange
For Each rCell In CellRange
If rCell.Interior.ColorIndex = FillColor Then
FillTotal = FillTotal + 1
End If
Next rCell
COUNTCOLOR = FillTotal
End Function

#excelart #excel #msexcel #basicexcel #advanceexcel #exceltutorial #learnexcel #excel for beginner