I have a macro that I am trying to write that counts the total number of yellow, red and green cells in Column V (V8 to V Last Row Minus 1 Row) of Sheet "Day Shift". I am trying to have the total count of colors appear on Sheet "Summary" Range D20 for Green, F20 for Yellow and H20 for Red. I have a code but the code includes the last row, which I am trying to exclude. Any assistance with this code would be greatly appreciated. I am new to this. Here is what I have
Sheets("Day Shift").Activate
Dim rng As Range, rCell As Range, Total As Double, LastRow As Long
LastRow = Cells(Cells.Rows.Count, "V").End(xlUp).Row
Set rng = Range("V8:V" & LastRow)
For Each rCell In rng
If rCell.DisplayFormat.Interior.Color = RGB(255, 255, 0) Then _
Total = Total + 1
Next rCell
Sheets("Summary").Activate
Sheets("Summary").Range("F20") = Total
Sheets("Day Shift").Activate
Dim rng As Range, rCell As Range, Total As Double, LastRow As Long
LastRow = Cells(Cells.Rows.Count, "V").End(xlUp).Row
Set rng = Range("V8:V" & LastRow)
For Each rCell In rng
If rCell.DisplayFormat.Interior.Color = RGB(255, 255, 0) Then _
Total = Total + 1
Next rCell
Sheets("Summary").Activate
Sheets("Summary").Range("F20") = Total