I am stuck on a piece of code that I am tweaking.
"Detail Report" has two columns: Column C is Pr Code and Column B is the line item associated with the code. Both of these come from comparing column L on two other worksheets. I would like to isolate the line items with text value "Pr Code" and then add up a quantity associated with it that comes from the second of the two compared sheets. I have tried an array and it gave me the wrong result, so I am trying to figure out what is wrong with this code:
I should get a value of 5, but I am getting zero.Sub PrNonMatch() Dim rng As Range Dim c As Variant Set rng = Worksheets("Detail Report").Range("C6:C10006") For Each c In rng If c.Vale = "Pr Code" Then Worksheets("Generalized Report").Range("E8") = Evaluate("=SUMPRODUCT(--('As Built'!I2:I10000))") Else ' There are no differences in Pr code Worksheets("Generalized Report").Range("E8") = "0" End If Next c End Sub





Reply With Quote
