VBA Formula Array Problem

nigelk

Well-known Member
Joined
Aug 30, 2008
Messages
537
Hi all,

I have the following array formula:

{=MIN(IF(AX11:BE11=0,"",AX11:BE11))}

which works fine if entered by hand.

But if I use the following:

Range(Cells(11, 58), Cells(CalcLR, 58)).FormulaArray = "=MIN(IF(AX11:BE11=0,"",AX11:BE11))"

I get the errror: " Unable to set the Formula array property of the Range class"

I know the range is set correctly. Can anyone help?

Thanks,Nigel
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
IF you want to express a literal quote character within a string, you need to use two quotes for each literal quote you want to express e.g.

"=MIN(IF(AX11:BE11=0,"""",AX11:BE11))"

That's how VBA interprets a Literal quote character from the quotes used to start\end the string
 
Upvote 0
Hi Nigel

EDIT: Try using R1C1 style referencing within the formula which will probably be:

Range(Cells(11, 58), Cells(CalcLR, 58)).FormulaArray = "=MIN(IF(RC50:RC57=0,"""",RC50:RC57))"
 
Upvote 0
Thanks for the replies, but still having problems.

The first cells answer (3) is correct,

The formula in the cell is:

{=MIN(IF(RC50:RC57=0,"",RC50:RC57))}


but then the same answer and formula, is shown in all cells.


Strange thing is, if I check on another cell it shows that it's referencing the correct range.
 
Last edited:
Upvote 0
I suspect you want this:

Code:
Cells(11, 58).FormulaArray = "=MIN(IF(RC50:RC57=0,"""",RC50:RC57))" 
 
Cells(11,58).Copy
 
Cells(11,58).Resize(CalcLR-11).offset(1).PasteSpecial xlPasteFormulas
 
Upvote 0
Sorry Richard, my mistake.

Everything working ok now.

Many thanks for your help.

Nigel
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,704
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top