FormulaArray getting error in VBA

LloydFinancials

Well-known Member
Joined
Apr 24, 2015
Messages
546
When I run this formula as activecell.formula in VBA, then go to the cell and press Shift+Ctr+Enter, it creates an array formula as expected:
=IF(LEN(A13),SUM(SUMIF(INDIRECT(VLOOKUP($B$3,Combos!A:C,2,0)),INDIRECT("'Accounts (2)'!"&ADDRESS(1,MATCH(A13,'Accounts (2)'!$1:$1,0))&":"&ADDRESS(COUNTA(INDIRECT("'Accounts (2)'!"&LEFT(ADDRESS(1,MATCH(A13,'Accounts (2)'!$1:$1,0),4),1)&":"&LEFT(ADDRESS(1,MATCH(A13,'Accounts (2)'!$1:$1,0),4),1))),MATCH(A13,'Accounts (2)'!$1:$1,0))),INDIRECT(VLOOKUP($B$3,Combos!A:C,3,0)))),)

When I run the same formula as activecell.formulaarray I get "Runtime Error 1004: Unable to set the FormulaArray property of the Range class"

Microsoft Office Professional Plus 2013
Windows 10

Please advise.

Thanks,

Luke
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The FormulaArray property is limited to 255 characters.

At first glance it looks as though you could use SUMPRODUCT rather than SUM and skip array-entry. I'd also suspect that using a table or dynamic named range would remove the need for all those INDIRECT calls.
 
Upvote 0
Solution
I think you may be right, trying to build the logic with a sumproduct but not seeing a solution yet. Here is a link to the workbook. Formula is in Recon!E:13.

 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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