-1

セル from_cell と同じ色を持つ範囲 rng 内のセルをフィルタリングすることになっている関数 FILTER_COL があります。

Function FILTER_COL(from_cell As String, rng As Range)
Dim colour As Integer
For Each cell In Range(from_cell)
    colour = cell.Interior.ColorIndex
Next cell

Dim Out As Variant
For Each cell In rng
    If cell.Interior.ColorIndex = colour Then
        Out.Add (cell.Value)
    End If
Next cell
FILTER_COL = Out
End Function

次に、結果を次のように SUM に入れます。

SUM(FILTER_COL("A55",K50:K52))

それは #VALUE を与えます! K50:K52 の範囲に A55 と同じ色のセルがあるとエラーになります。

4

1 に答える 1