Mixphonics
New Member
- Joined
- Sep 21, 2012
- Messages
- 21
Hello Mr. Excel forum,
I have been using a custom function in one of my workbooks for over a year. Recently I noticed that that function stopped working correctly along with another function I use. I am able to run a macro that I wrote without any issues in the same workbook and macro trust level settings are set to enable all macros. Here is the function that I have been using which recently stopped working giving me the #NAME? message in each cell that I try to use it with:
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
I copied this function off the web but would appreciate any help if anyone knows how to correct this errror?
Best regards,
Mixphonics
I have been using a custom function in one of my workbooks for over a year. Recently I noticed that that function stopped working correctly along with another function I use. I am able to run a macro that I wrote without any issues in the same workbook and macro trust level settings are set to enable all macros. Here is the function that I have been using which recently stopped working giving me the #NAME? message in each cell that I try to use it with:
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
I copied this function off the web but would appreciate any help if anyone knows how to correct this errror?
Best regards,
Mixphonics