View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to get formula type in VBA

ActiveCell.HasArray is true if it is an array formula.

from help on HasArray

True if the specified cell is part of an array formula. Read-only Variant.

--
Regards,
Tom Ogilvy


"Charlie" wrote in message
...
Is there a property that returns whether or not the formula in a cell is

an
array formula?

I can insert a formula or an array formula into a cell no problem, but
regardless of which way I insert it both the .Formula and the

..FormulaArray
properties return identical strings. I would've thought that one or the
other would return empty.

The following Debug.Print statements show identical strings whether I

insert
the formula string into .Formula or .FormulaArray

Range("C1").Formula = "=SUM(IF(A1:A5=1,B1:B5))"
Debug.Print Range("C1").FormulaArray
Debug.Print Range("C1").Formula

Range("C1").FormulaArray = "=SUM(IF(A1:A5=1,B1:B5))"
Debug.Print Range("C1").FormulaArray
Debug.Print Range("C1").Formula

Any ideas?
TIA