Hi guys,
(Hopefully) quick question for you. I'm trying to use SumIf and it's been giving me a heck of a time all afternoon. I've tried using the worksheetfunction.sumif route and couldn't seem to get the syntax correct. I'd prefer the worksheetfunction route, as I don't need the formula stored, but it would be great to have both of these pieces of code for reference online - I scoured Google, and the examples I found were pretty weak.
I've recorded the macro (hence the R1C1 references in the second example) and had it work perfectly, but when I replaced row references with my variables, it went back to displaying "TRUE." I'm including all the code here.
Variables:
expr = 3 to 38 (For loop)
startrow = the starting row for the reference data
endrow = the ending row for the reference data
thresh = minimum threshold (a number)
Syntax error here:
Returns "TRUE" instead of the sum I'm looking for:
Recorded macro that works:
Thanks for all your help! Love the forum... It's been a great resource and I hope to one day be on the other end of the questions when I get a little better at this. :-/
Bookmarks