The issue is that you cannot perform array comparisons like that in VBA.
I would suggest you redo the calculations using Evaluate:
for examplewc.Cells(2, 4) = ws.Evaluate("SumProduct(--(Month(AN2:AN" & lastRow & ")=2)")
The issue is that you cannot perform array comparisons like that in VBA.
I would suggest you redo the calculations using Evaluate:
for examplewc.Cells(2, 4) = ws.Evaluate("SumProduct(--(Month(AN2:AN" & lastRow & ")=2)")
Be as you wish to seem