J
jeremiah
I am using a SumColor function and is returning the #Name? error. Haven't
used many functions so don't quite understand what the issue is.
code is below along with =SumColor (A10, D1D60)
Function SumColor(rColor As Range, rSumRange As Range)
Dim rCell As Range
Dim iCol As Integer
Dim vResult
iCol = rColor.Interior.ColorIndex
For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = WorksheetFunction.SUM(rCell) + vResult
End If
Next rCell
SumColor = vResult
End Function
Thanks again for any help.
used many functions so don't quite understand what the issue is.
code is below along with =SumColor (A10, D1D60)
Function SumColor(rColor As Range, rSumRange As Range)
Dim rCell As Range
Dim iCol As Integer
Dim vResult
iCol = rColor.Interior.ColorIndex
For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = WorksheetFunction.SUM(rCell) + vResult
End If
Next rCell
SumColor = vResult
End Function
Thanks again for any help.