У меня есть код lColorCounter, который работает, но он медленный. Есть ли более быстрый способ зацикливания с помощью lColorCounter?
Dim rng As Range
Dim lColorCounter As Long
Dim rngCell As Range
Set rng = Sheets("MASTER LINE LIST").Range("C2:Z2000")
lColorCounter = 0
For Each rngCell In rng
'Checking BLUE color
If Cells(rngCell.Row, rngCell.Column).DisplayFormat.Interior.Color = RGB(0, 176, 240) Then
lColorCounter = lColorCounter + 1
End If
Next
Sheets("Status").Range("C5") = lColorCounter
lColorCounter = 0
For Each rngCell In rng
'Checking Yellor color
If Cells(rngCell.Row, rngCell.Column).DisplayFormat.Interior.Color = RGB(255, 255, 0) Then
lColorCounter = lColorCounter + 1
End If
Next
Sheets("Status").Range("B5") = lColorCounter