📋 VBA 代码Function SumByColor(CellColor As Range, SumRange As Range) As Double Dim Cell As Range Application.Volatile For Each Cell In SumRange If Cell.Interior.Color = CellColor.Interior.Color Then SumByColor = SumByColor + Cell.Value End If Next Cell End Function