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 Parameters of SUMIF in VBA

msgbox application.sumif(worksheets("sheet1").range("e1:e 226"), "0", _
worksheets("sheet1").range("N1:N226"))

Watch your ranges, too (226 or 224????).

"mdalamers via OfficeKB.com" wrote:

Please help me.

I try to run a SUMIF worksheet function from my VBA code.
Basically this is the troublesome line.

MsgBox Application.WorksheetFunction.SumIf("$E$1:$E$226", "0", "$N$1:$N$224")

When I run it, Excel gives me a compile error, type mismatch, highlighted on:
"$E$1:$E$226"

What am I doing wrong?

Regards,

Michiel.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1


--

Dave Peterson