统计每一列,每一种颜色的个数
统计每一列,每一种颜色的个数vba吧,公式,可以看看get.cell 你会吗,帮帮忙 Sub ColorCount()
Dim rngCell As Range, rngUnion As Range, i%
For i = 2 To Range("a" & Rows.Count).End(xlUp).Row
For Each rngCell In Cells(i, 1).Resize(1, 3)
If rngCell.Interior.Color = 255 Then
If rngUnion Is Nothing Then
Set rngUnion = rngCell
Else
Set rngUnion = Application.Union(rngUnion, rngCell)
End If
End If
Next rngCell
If Not rngUnion Is Nothing Then Cells(i, 4) = rngUnion.Columns.Count
Set rngCell = Nothing
Set rngUnion = Nothing
For Each rngCell In Cells(i, 1).Resize(1, 3)
If rngCell.Interior.Color = 10498160 Then
If rngUnion Is Nothing Then
Set rngUnion = rngCell
Else
Set rngUnion = Application.Union(rngUnion, rngCell)
End If
End If
Next rngCell
If Not rngUnion Is Nothing Then Cells(i, 5) = rngUnion.Columns.Count
Set rngCell = Nothing
Set rngUnion = Nothing
For Each rngCell In Cells(i, 1).Resize(1, 3)
If rngCell.Interior.Color = 5296274 Then
If rngUnion Is Nothing Then
Set rngUnion = rngCell
Else
Set rngUnion = Application.Union(rngUnion, rngCell)
End If
End If
Next rngCell
If Not rngUnion Is Nothing Then Cells(i, 6) = rngUnion.Columns.Count
Set rngCell = Nothing
Set rngUnion = Nothing
Next i
End Sub
用函数怎么做 用函数怎么操作 颜色代号 :奌选H2-->CTR+F3-->定义名称QQ(随意 非指令均可 如 QQ ,AA…)-->参照到公式=GET.CELL(63,A2)-->确定-->H2输入公式=QQ-->右拉 下拉-->颜色改变或重开机 重新RUN与下拉一次
D2:F17=TEXT(COUNTIF($H2:$J2,CHOOSE(COLUMN(A1),3,29,6)),"0;;")
可以解析一下步奏? 看一看,对不对?
以传附件~~~~~~~