Hi everyone.
I am trying to figure out a formula that will help me count pink cells with initials in them.
I already have the VBA for counting colors, and I know the formula for counting specific text, but I need to combine the two.
For example, in the workbook, there are two sheets.
The first sheet (Project Totals) has a table that is meant to count what's going on in the second sheet.
In the L1 TM sheet, if cells in Columns G-P meet a certain criteria, I have a macro that turns the Cells in Column F pink. If the cells in Columns G-P don't meet the set criteria, the Macro turns them orange.
Column F will contain the initials of the person who performed the test that provides the results in Columns G-P. So I need to count each person's initials separately.
I tried this:
Formula:
=IF(CountCellsByColor('L1 TM'!$F$24:$F$5000, B25), COUNTIF('L1 TM'!$F$24:$F$5000, "ABC"))
but all that does is count the number of cells that contain the person's initials and not the cell color.
Alternatively, I don't mind editing the code to just change each person's initials to a color specific to them, but I am not sure how to do that.
This is the code I have.
Dim i As Long, lr As Long
lr = Range("F" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = 3 To lr
If Range("G" & i).Interior.Color = 5287936 Or Range("G" & i).Interior.Color = 65535 Then
If Range("H" & i).Interior.Color = 5287936 Or Range("H" & i).Interior.Color = 65535 Then
If Range("I" & i).Interior.Color = 5287936 Or Range("I" & i).Interior.Color = 65535 Then
If Range("K" & i).Interior.Color = 5287936 Or Range("K" & i).Interior.Color = 65535 Then
If Range("M" & i).Interior.Color = 5287936 Or Range("M" & i).Interior.Color = 65535 Then
Range("F" & i).Interior.ColorIndex = 22
End If
End If
End If
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
If anyone can help, I would greatly appreciate it!
Bookmarks