unable to set formulaarray property of the range class

Barbatian

New Member
Joined
Sep 12, 2014
Messages
25
Hello,

I know this is a common error but can't see a reason why I receive such error:

.Range(.Cells(2, Date_Column), .Cells(LPF_LastRow, Date_Column)).FormulaArray = "=MAX(('Data Base'!B$2:B$20000=B3)*('Data Base'!C$2:C$20000))"

It doesn't reach 255 character I guess.
When I do this with Formula only it works.

Would be thankful for help.
Best Regards
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
That won't do what you need even if it did work. You need to array enter it into one cell and then fill down, so you need this:

Code:
With .Cells(2, Date_Column)
.FormulaArray = "=MAX(('Data Base'!B$2:B$20000=B3)*('Data Base'!C$2:C$20000))"
.Autofill Destination:=.Range(.Cells(2, Date_Column), .Cells(LPF_LastRow, Date_Column))
End With
 
Upvote 0
Ohh, why am I so stupid. Jesus. Thank you very much. It worked for inserting Array into the cell, however .autofill didn't work with following error:
"Autofill method of Range class failed"
 
Upvote 0
What's the value of LPF_LastRow when you run the code?
 
Upvote 0
First of all big thank you since your provide comprehensive solution.
The problem with autofill was with:
.Range and .Cells, which refer to "With .Cells(2, Date_Column)" but should refer to Worksheet, so the final version is:
.Autofill Destination:=ws_LPF.Range(ws_LPF.Cells(2, Date_Column), ws_LPF.Cells(LPF_LastRow, Date_Column))

Thank you so much!!
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,649
Members
448,975
Latest member
sweeberry

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