.....so it doesn't work. It will work if I manually select a cell color, but that is impossible for this purpose
I need certain cells to calculate into another cell per the color that is affixed to the dropdown choice.
This VBA worked for NON-DROPDOWN colored cells:
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)
Dim rCell As Range
Dim lCol As Long
Dim vResult
lCol = rColor.Interior.ColorIndex
If SUM = True Then
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = WorksheetFunction.SUM(rCell, vResult)
End If
Next rCell
Else
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = 1 + vResult
End If
Next rCell
End If
ColorFunction = vResult
End Function
Can anyone help? Oh thank you!
-T
Bookmarks