excel - Countif, range, and cells -


this question has answer here:

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

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -