evaluate question

G

Gary Keramidas

tried both of these sets of formulas, they return the correct result if the right sheet is active. how would i write the formula so it wouldn't matter which sheet is active?
the macro should only be run when this sheet is active, but i wanted to see if the formula could be written to take that into consideration. now i just activate the sheet before the code is run.

misScans = Evaluate("countblank(" & ws.Range("F6:F" & lastrow).Address(0, 0) & ")")
or
misScans = Evaluate("SUMPRODUCT((F6:F11049="""")*(A6:A11049=""""))")

totalScans = Evaluate("SUMPRODUCT((F6:F11049>"""")*(A6:A11049>""""))")
or
totalScans = Evaluate("COUNTA(" & ws.Range("A6:A" & lastrow).Address(0, 0) & ")")
 
J

JMB

try setting the fourth parameter of Address (external) to true:

misScans = Evaluate("countblank(" & ws.Range("F6:F" & lastrow).Address(, , ,
True) & ")")
 
G

Gary Keramidas

thanks, jm. i thought i tried that too, but must have had the wrong combination.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top