Results 1 to 10 of 10

Thread: Isolating errors 2

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi NWE!
    The code below is written incorrectly, but the runtime will prompt errors,
    So it's not the cause of your problem.
    If c.Vale = "Pr Code" Then
    For each...next loops get the result of the last loops if they do not jump out of the condition.
    Sub PrNonMatch()
      Dim rng As Range
      Dim c As Variant
      Set rng = Worksheets("Detail Report").Range("C6:C10006").Find("Pr Code", lookat:=xlWhole)
      With Worksheets("Generalized Report")
        If rng Is Nothing Then
          .[e8] = "0"
        Else
          .[e8] = Evaluate("=SUMPRODUCT(--('As Built'!I2:I10000))")
        End If
      End With
    End Sub
    Last edited by 大灰狼1976; 04-29-2019 at 06:35 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
  •