View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Sullentrup Bob Sullentrup is offline
external usenet poster
 
Posts: 25
Default Visual Studio Tools for Office - CountIf, Ctrl-Shift-Enter, Ar

Simon,

This may turn the trick, but it may not.

It's not just a matter of evaluating a formula, but to evaluate an array
formula.

I believe there are two properties, Formula and FormulaArray, that are
associated with a cell. When you hit '(Enter)', the expression gets assigned
to the Formula property. When Ctrl-Shift-Enter, to the latter.

I'll experiment with this and let the list know.


--
Bob Sullentrup


"Simon Murphy" wrote:


Bob

If you want to use countif as if it were array entered into a cell, but
dont have it in a cell then use application.evaluate("countif formula as
a string") as in

Application.Evaluate("=SUM(1/COUNTIF(A1:A6, A1:A6))")


Cheers
Simon


--
Simon Murphy
------------------------------------------------------------------------
Simon Murphy's Profile: http://www.excelforum.com/member.php...o&userid=26538
View this thread: http://www.excelforum.com/showthread...hreadid=471231