Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 316 Bytes

sumcolor.md

File metadata and controls

14 lines (12 loc) · 316 Bytes
Function SumByColor(CellColor As Range, SumRange As Range)
	Application.Volatile
	Dim ICol As Integer
	Dim TCell As Range
	ICol = CellColor.Interior.ColorIndex
	For Each TCell In SumRange
		If ICol = TCell.Interior.ColorIndex Then
			SumByColor = SumByColor + TCell.Value
		End If
		Next TCell
	End Function