想统计底纹为黄色的单元格的个数,黄色单元格总共11个(从A1到A11),并把这11个单元格标黄了,其他单元格均未做任何操作。BVA代码如下:
Public Sub aaaa()
Dim a, i
i = 1
Set a = Cells(i, "a")
Do Until a.Value = ""
If a.iterior.Color = RGB(225, 225, 0) Then
i = i + 1
End If
Loop
MsgBox i - 1
End Sub
Public Sub aaaa()
Dim a, i
i = 1
Do Until Cells(i, "a") = ""
Set a = Cells(i, "a")
If a.Interior.Color <> xlNone Then
i = i + 1
End If
Loop
MsgBox i - 1
End Sub