统计每一列颜色的个数,如左边
统计每一列颜色的个数,如左边函数是色盲,分辨不出来的
要做这个题,必须用VBA 简单代码可实现。
Private Sub CommandButton1_Click()
Dim rn As Range
Dim r As Range, c&
Set rn = Range(Range("A10000").End(xlUp), "C1")
For Each r In rn
If r.DisplayFormat.Interior.Color <> vbWhite Then
Select Case r.DisplayFormat.Interior.Color
Case 255: c = 4
Case 10498160: c = 5
Case 5296274: c = 6
End Select
Cells(r.Row, c) = Cells(r.Row, c) + 1
End If
Next
End Sub
页:
[1]