FormulaArray with variable

Konrado

New Member
Joined
Jun 17, 2014
Messages
34
Sub GLO()


Hi, I want to use variable in my FormulaArray, but it doesn't work. If you know how to do it, please help me. Below code:

Dim LastRowFinal As Long


LastRowFinal = Worksheets("DATA").Range("A" & Rows.Count).End(xlUp).Row


Worksheets("View").Activate


TempString = "=SUM((R4C5=DATA!R4C4:R" & LastRowFinal & "C4)*(IF(R5C5<>""TOTAL"",R5C5=DATA!R4C5:R" & LastRowFinal & "C5,1))*(RC3=DATA!R4C14:R" & LastRowFinal & "C14)*(RC4=DATA!R4C12:R" & LastRowFinal & "C12)*(R11C=DATA!R2C19:R2C66)*(CHOOSE(R218C6,R218C8=DATA!R3C19:R3C66,R218C8>=DATA!R3C19:R3C66,R218C8<DATA!R3C19:R3C66))*(DATA!R4C19:R" & LastRowFinal & "C66))"


Worksheets("View").Range("E14").FormulaArray = TempString


End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,195,748
Messages
6,011,426
Members
441,614
Latest member
TiaGtz

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
Top