Hi all,
I am attempting to run Evaluate Sumproduct in VBA across different sheets
I have one sheet that stores all the data called "DATA"
I have attempted to set the ranges so that the function can reference these more easily
Eventually I will need to run this formula for every item requested in column A.... for Sheet CusomterX
Any pointers in where I've gone wrong or astray would be greatly appreciated.
I am attempting to run Evaluate Sumproduct in VBA across different sheets
I have one sheet that stores all the data called "DATA"
I have attempted to set the ranges so that the function can reference these more easily
Code:
Dim Rng1 As Range, Rng2 As Range, Rng3 As Range, Rng4 As Range
Set Rng1 = Sheets("DATA").Range("C:C") ' Stock
Set Rng2 = Sheets("DATA").Range("A:A") ' Account number
Set Rng3 = Sheets("DATA").Range("E:E") ' Incoming
Set Rng4 = Sheets("DATA").Range("H:H") ' On hand
Sheets("CustomerX").select
Range("E2") = Evaluate("=SUMPRODUCT((Rng2 = 2471)*(rng1 = [U]Sheets("customerX").Range("A2")[/U],Rng3)")
Eventually I will need to run this formula for every item requested in column A.... for Sheet CusomterX
Any pointers in where I've gone wrong or astray would be greatly appreciated.