悠悠古韵 发表于 2021-11-24 19:11:00

统计每一列,每一种颜色的个数

统计每一列,每一种颜色的个数

唐晓锋 发表于 2021-11-28 06:02:37

vba吧,公式,可以看看get.cell

我本凡人 发表于 2021-11-30 02:20:36

你会吗,帮帮忙

鱼腥草 发表于 2021-12-1 21:14:15

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

杭州鱼尾 发表于 2021-12-5 11:09:27

用函数怎么做

心凉了 发表于 2021-12-6 22:53:21

用函数怎么操作

若羽馨玥 发表于 2021-12-8 06:42:06

颜色代号 :奌选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;;")

满堂红 发表于 2021-12-17 01:33:33

可以解析一下步奏?

富饶 发表于 2021-12-19 01:16:46

看一看,对不对?

风中男子 发表于 2022-1-2 03:01:48

以传附件~~~~~~~
页: [1] 2 3
查看完整版本: 统计每一列,每一种颜色的个数