Excel(エクセル) VBA入門:色付きのセルを数える/合計する |
スポンサードリンク | |
Function ColorCount(R1 As Range, C As Range) Dim r As Range Application.Volatile ColorCount = 0 For Each r In R1 If r.Interior.Color = C.Interior.Color Then ColorCount = ColorCount + 1 End If Next r End Function |
Function ColorSum(R1 As Range, C As Range) Dim r As Range Application.Volatile ColorSum = 0 For Each r In R1 If r.Interior.Color = C.Interior.Color Then ColorSum = ColorSum + r.Value End If Next r End Function |
スポンサードリンク
PageViewCounter
Since2006/2/27