此代码运行3秒钟,没有错误。但我没有结果。 我应该有超过1000种红色的字体。
Sub Count_Flanges()
Application.ScreenUpdating = False
Dim Rng As Range
Dim lColorCounter As Long
Dim rngCell As Range
Set Rng = Sheets("master line list").Range("C2:Z1633")
lColorCounter = 0
For Each rngCell In Rng
If Cells(rngCell.Row, rngCell.Column).DisplayFormat.Font.Color = RGB(255, 0, 0) Then
lColorCounter = lColorCounter + 1
End If
Next
Sheets("status").Range("D3") = lColorCounter
Sheets("status").Range("A1") = lColorCounter / 2 & " " & "Total Duplicates"
Sheets("status").Range("A2") = Sheets("status").Range("D5").Value - lColorCounter / 2 & " " & "Flanges"
Application.ScreenUpdating = True
End Sub