Hello!
I created a UDF called SumByColor. It sums all the numbers that are in a particular colored cell of your choosing. It's working, however it sums the numbers up to a whole number instead of including the decimals. Here is my function:
Function SumByColor(CellColor As Range, rRange As Range)
Dim cSum As Long
Dim ColIndex As Integer
ColIndex = CellColor.Interior.ColorIndex
For Each cl In rRange
If cl.Interior.ColorIndex = ColIndex Then
cSum = WorksheetFunction.Sum(cl, cSum)
End If
Next cl
SumByColor = cSum
End Function
How can I get it to sum up the numbers including the decimals places?
Thank you!
Bookmarks