Hello all,
Does anyone have any idea what's wrong here?
I was trying to transfer worksheet array formula into VBA. I wanted to use quartiles to draw box plot. I recorded a macro and press F2 then "Ctrl+Shift + Enter"in the worksheet cells to transfer the worksheet formula into VBA. But it says:
Run-time error '1004':
Unable to set FormulaArray property of the Range class.
My VBA code from recording macro is as follows:
Range("D33").Select
Selection.FormulaArray = _
"=IFERROR(IF(R6C2=""See result for exact number of units"",QUARTILE(IF(Data!C14=IF(R2C2=""All"",Data!C14,R2C2),IF(Data!C15=IF(R3C2=""All"",""<>"",R3C2),IF(Data!C16=IF(R4C2=""All"",Data!C16,R4C2),IF(Data!C4=R5C2,IF(Data!C5=R7C2,Data!C12))))),1),QUARTILE(IF(Data!C14=IF(R2C2=""All"",Data!C14,R2C2),IF(Data!C15=IF(R3C2=""All"",""<>"",R3C2),IF(Data!C16=IF(R4C2=""All"",Data" & _
"!C16,R4C2),IF(Data!C4=R5C2,IF(Data!C5>=R29C1,IF(Data!C5<=R29C2,Data!C12)))))),1)),""N/A"")" & _
""
Would appreciate very much if anyone can tell me what's going wrong here.
Does anyone have any idea what's wrong here?
I was trying to transfer worksheet array formula into VBA. I wanted to use quartiles to draw box plot. I recorded a macro and press F2 then "Ctrl+Shift + Enter"in the worksheet cells to transfer the worksheet formula into VBA. But it says:
Run-time error '1004':
Unable to set FormulaArray property of the Range class.
My VBA code from recording macro is as follows:
Range("D33").Select
Selection.FormulaArray = _
"=IFERROR(IF(R6C2=""See result for exact number of units"",QUARTILE(IF(Data!C14=IF(R2C2=""All"",Data!C14,R2C2),IF(Data!C15=IF(R3C2=""All"",""<>"",R3C2),IF(Data!C16=IF(R4C2=""All"",Data!C16,R4C2),IF(Data!C4=R5C2,IF(Data!C5=R7C2,Data!C12))))),1),QUARTILE(IF(Data!C14=IF(R2C2=""All"",Data!C14,R2C2),IF(Data!C15=IF(R3C2=""All"",""<>"",R3C2),IF(Data!C16=IF(R4C2=""All"",Data" & _
"!C16,R4C2),IF(Data!C4=R5C2,IF(Data!C5>=R29C1,IF(Data!C5<=R29C2,Data!C12)))))),1)),""N/A"")" & _
""
Would appreciate very much if anyone can tell me what's going wrong here.