On 2002-12-11 14:53, Egad wrote:
To manually place an array formula (like the one below) into a cell I use CTRL-SHIFT-ENTER.
=sum(if(b1:B100="Yes",c1:c100*d1:d100))
How would I do it thru vba? It doesn't seem to work like this:
cells(1,1).value=...formula...
On 2002-12-11 15:00, Paul B wrote:
try this
Selection.FormulaArray = _
"=sum(if(b1:B100=""Yes"",c1:c100*d1:d100))"
To make it a little interactive, try:
UserResponse = Chr$(34) & InputBox("Yes or No?") & Chr$(34)
Selection.FormulaArray = "=sum(if(b1:B100=" & UserResponse & ",c1:c100*d1:d100))"