0

MS Excel 2010 で背景色に基づいてセルを合計する方法。

=colorfunction(B2,F12:F192,TRUE)

しかし、それは機能していません

4

1 に答える 1

0

早速書いたものを試してみてください。はい、考えられるすべてのケースをカバーして処理するように改善できます。しかし、それはあなたの宿題として残してください。

  Function clrsum(var As Range)
  FirstRow = var.Cells(1, 1).Row
  LastRow = var(var.Count).Row
  col = var.Cells(1, 1).Column

  For i = FirstRow To LastRow
      If Cells(i, col).Interior.ColorIndex = <put some color index here> Then
          clrsum = clrsum + Cells(i, col)
      End If
  Next
  End Function

次に、 =clrsum(A1:A10) のような式を使用します

于 2013-10-10T08:55:29.473 に答える