excel - Countif, range, and cells -
this question has answer here:
- why range work, not cells? 1 answer
i have following code in vba returning 1004 error:
e = worksheetfunction.countif(worksheets("tg teams").range(cells(4, w), cells(12, w)), worksheets("calcs").range("b" & a)) e, w, , integers.
the code meant check if name in calcs sheet appears in tg teams sheet. reason range variable countif needs check different column each week.
any ideas how resolve error 1004 when run this?
you need qualify (cells(4, w), cells(12, w)) worksheet ("tg teams") in, use with:
with worksheets("tg teams") e = worksheetfunction.countif(.range(.cells(4, w), .cells(12, w)), worksheets("calcs").range("b" & a)) end
Comments
Post a Comment