Bagharmin
Board Regular
- Joined
- Nov 22, 2010
- Messages
- 168
My code is giving me a Type Mismatch error on a particular line and I can't see why. The code in question is below.
Sorry for the poor formatting.
In looking at it, AllCodes.Address is "$D$3:$D$22899" and CodeNumber is actually in column D and is "0005". All entries in column D are text. EEHires.Address is "$L$3:$L$22899" and EETerms.Address is "$M$3:$M$22899" while EndDate is 40603 (3/1/2011 on the sheet) and StartDate is 40237 (2/28/2010 on the sheet).
CodeNumber is Dim'd as Variant while TotalActive, EndDate, and StartDate are all Double. Can anyone tell by looking where the Type Mismatch is coming from?
Thank you.
Code:
With Worksheets("Employees")
TotalActive = .Evaluate("SUMPRODUCT((" & AllCodes.Address & "=" & Chr(34) & CodeNumber & Chr(34) & ")*(" & EEHires.Address & "<" & EndDate & _
")*(" & EETerms.Address & ">" & StartDate & "))")
End With
Sorry for the poor formatting.
In looking at it, AllCodes.Address is "$D$3:$D$22899" and CodeNumber is actually in column D and is "0005". All entries in column D are text. EEHires.Address is "$L$3:$L$22899" and EETerms.Address is "$M$3:$M$22899" while EndDate is 40603 (3/1/2011 on the sheet) and StartDate is 40237 (2/28/2010 on the sheet).
CodeNumber is Dim'd as Variant while TotalActive, EndDate, and StartDate are all Double. Can anyone tell by looking where the Type Mismatch is coming from?
Thank you.