Thread: Formula Error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Formula Error

Range("K13").HasArray = true

"Al" wrote:

Thanks to Jacob Skaria who go me to this point with this issue. It started
as a formula question and then moved to VBA. Im still having problems so I
am moving it here. I am trying to enter the array formula:

=SUM(IF(ISERROR(MATCH($C$14:$C$500,'G:\MyPath\[MyFile.xls]Sheet4'!$A$1:$A$500,0)),IF($F$14:$F$500="7-F",IF($I$14:$I$500="Roger",IF($E$14:$e$500="Widget ",IF($J$14:$J$500="s",IF(K14:K500<"N/A",ROUNDUP(1.02*(K$14:K$500),0))))))))"

If I enter the formuala (Ctrl+shift+enter) it works. However when in my
code I use

Range("K13").FormulaArray =
"=SUM(IF(ISERROR(MATCH($C$14:$C$500,'G:\MyPath \[MyFile.xls]Sheet4'!$A$1:$A$500,0)),IF($F$14:$F$500=""7-F"",IF($I$14:$I$500=""Roger"",IF($E$14:$e$500=""Wi dget"",IF($J$14:$J$500=""s"",IF(K14:K500<""N/A"",ROUNDUP(1.02*(K$14:K$500),0))))))))"

in my code, I get "Unable to set FormulaArray Property of the
range class".

This is a variant of another formula in the code with an added IF, and the
other formula works when the code is executed. I have copied the formula and
inserted it in
Range("K13").FormulaArray = "Formula" and replaced the single quotes with
double quotes. What am I doing wrong?

Thanks!