View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gixxer_J_97[_2_] Gixxer_J_97[_2_] is offline
external usenet poster
 
Posts: 206
Default mixing of vba and sumproduct

You rock!

thanks!

J

"Bernie Deitrick" wrote:

J,

For your example:
Application.Evaluate("SumProduct((OrderMonthName=B 1)*1)")


For your code:
tot = tot + Application.Evaluate("SumProduct((OrderMonthName= """ _
& MonthName(m) & """)*1)")

HTH,
Bernie
MS Excel MVP


"Gixxer_J_97" wrote in message
...
hi all,

i would like to use vba and the sumproduct function

the excel formula version would be something like

=SumProduct((OrderMonthName=B1)*1)

i am trying
with sheets("Sheet1")
tot = tot + cdbl(Application.SumProduct((.Range("OrderMonthNam e") =
monthName(m))*1))
end with

but i am getting a type mismatch - i have a feeling i am using this
incorrectly.

any help?

tia!

J