Thread: Why Evaluate?
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Why Evaluate?

Dave,

When in VBA, you could write code that does some complex operation, but in
many cases you can call worksheet functions directly from within VBA. Many
of these are called directly, such as

myVar = Application.COUNTIF(Range("A1:A10"),"Y")

Sometimes, Application.function, or Worksheetfunction.function_name doesn't
work, so this is where Evaluate scores.

For example, SUMPRODUCT, which can handle complex multi-conditional tests,
is not supported, such as
=SUMPRODIUCT(--(MONTH(A1:A10)=3),--(B1:B10="Y"),C1:C10)").

Or an array formula, such as =MIN(IF(A1:A100,A1:A10)).

Or a complex formula where Application.function_name just gets too
convoluted.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dave Unger" wrote in message
ups.com...
Hi Bob,

Sorry to bother you again, but could you provide me with one example
where using Evaluate is necesary? Thank you

regards

DaveU