Even placing "Set CellColor" in the code still returns the error.
Here is my complete code:
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
'This code generates totals on the active sheet. All cell's with an Interior Color of light green
'will total in the Exempt total. All with no fill will total in Taxable Total
Dim myCell As Range
Dim iCol As Integer
Dim myTotal
Dim CellColor As Range
Dim SumRange As Range
Dim FinalRow As Range
Set FinalRow = Range("A65536").End(xlUp)
FinalRow = Range("A65536").End(xlUp).Row
Set CellColor = Dates!A2
SumRange = Range(Cells(4, "AI"), Cells(FinalRow - 3, "AI"))
iCol = CellColor.Interior.ColorIndex 'get the target color
For Each myCell In SumRange 'look at each cell in the designated range
If myCell.Interior.ColorIndex = iCol Then 'if the cell color matches the target Color
myTotal = WorksheetFunction.Sum(myCell) + myTotal 'add the value in the cell to the total
End If
Next myCell
Cells(FinalRow - 1, "AI") = myTotal
End Sub