Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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...tions/200703/1 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Check your other post.
"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...tions/200703/1 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You need to qualify the address using a range object as in if you are using
the activesheet: MsgBox Application.WorksheetFunction.SumIf( _ Range("$E$1:$E$226"), "0", Range("$N$1:$N$224")) End Sub -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "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...tions/200703/1 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Martin. That worked well!
Now I can finally go home! M. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...tions/200703/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run-time 13 Type mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
type mismatch--how to fix | Excel Discussion (Misc queries) | |||
Type mismatch on LastRow | Excel Discussion (Misc queries) | |||
Why type mismatch - R/T error 13 | Excel Discussion (Misc queries) |