I have an array, which represents a list of criteria that I want to sum a column of a table by.
Formula:
myCustomers = Split("Customer 1,Customer 2,Customer 3", ",")
For i = 0 To UBound(myCustomers)
If myCustomers(i) = "Customer 1" Then
[d8].Select
Do Until Selection.FormulaR1C1 = ""
Selection.Offset(1, 0).Select
Loop
Selection.FormulaR1C1 = "=SumIfs(T_data2([Total Weight]), T_data2([Customer]), myCustomers(i))" 'The bug is here
Else
...
loop
For some reason, that SumIfs says Application-defined or Object-defined error. I am positive that T_data2 is a table that exists. That table DOES have Total Weight and Customer columns. What am I doing wrong?
Thank you for the help!
Bookmarks