View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Run-time error 13: Type mismatch

I didn't look very closely, but this looked strange:

"$" & endRow & "TODAY())," & _


I'd try:

"$" & endRow & ""& TODAY())," & _


or even using VBA's Date

"$" & endRow & "" & date & ")," & _


If that doesn't help, then what are the values in those variables passed to the
function?

Be specific to make testing easier.
mktrow = 12, startrow = ...



Ayo wrote:

Can someone tell me why I am getting the above error in this function. It
only happens at a particular point in my code. It works fine until it get to
that point. And I can't figure out what the mismatch is.

Function msProjected(msDate As String, msStatus As String, currRow As
Integer, MktRow As Integer, startRow As Integer, endRow As Integer) As Integer
msProjected = Evaluate("=IF(AND(D" & currRow & "<0,D" & currRow &
"<"""")," & _
"SUMPRODUCT(--('BO Download'!$B$" & startRow & ":$B$" & endRow &
"=B" & MktRow & ")," & _
"--('BO Download'!$F$" & startRow & ":$F$" & endRow & "=C" &
currRow & ")," & _
"--('BO Download'!$H$" & startRow & ":$H$" & endRow &
"=""Selected"")," & _
"--('BO Download'!$" & msDate & "$" & startRow & ":$" & msDate &
"$" & endRow & "TODAY())," & _
"--('BO Download'!$" & msStatus & "$" & startRow & ":$" &
msStatus & "$" & endRow & "=""P"")),"""")")

End Function


--

Dave Peterson