Sub FontColor()
Sheets(2).Cells.Clear
Dim Mg As Range
Dim i, j
i = 1
j = 1
DoEvents
For Each Mg In Sheets(1).UsedRange
If Sheets(2).Cells(j, 1) = "" Then
Sheets(2).Cells(j, 1) = Mg.Font.Color
Sheets(2).Cells(j, 1).Interior.Color = Mg.Font.Color
End If
If Mg.Value <> "" Then
x = 0
For j = 1 To i
If Mg.Font.Color = Sheets(2).Cells(j, 1) Then
Sheets(2).Cells(j, 2) = Sheets(2).Cells(j, 2) + 1
x = 1
Exit For
End If
Next j
If x = 0 Then
Sheets(2).Cells(i + 1, 1) = Mg.Font.Color
Sheets(2).Cells(i + 1, 1).Interior.Color = Mg.Font.Color
Sheets(2).Cells(i + 1, 2) = 1
i = i + 1
End If
End If
Next Mg
End Sub
你的表格要在 表1中。
在表2中统计结果
追问公式在Excel表格里该如何运用? 求详细说下,Excel玩的不熟