Results 1 to 10 of 10

Thread: Isolating errors 2

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Nov 2018
    Posts
    75
    Location

    Post Isolating errors 2

    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:

    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
    I should get a value of 5, but I am getting zero.
    Last edited by Aussiebear; 01-10-2025 at 01:12 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •