title: Sum Totals of a various sections is not working properly
body: <p>I'm working on a loop to select a particular header in a sheet and sumtotal the numbers below the header. The header is available under different categories so the loop runs through to find the header- The Sumtotal is not working fine from the second loop.</p>
  <pre><code>Sub LoopText()
      Dim rFirst As Range, r As Range
      Dim A As Range
      Dim Sumtotal As Variant
      
      Sheets(&quot;FA_CP_Report&quot;).Select
      Range(&quot;A1&quot;).Select
      Set A = Range(&quot;F:G&quot;)
     Do
        If rFirst Is Nothing Then
           Set rFirst = A.Find(What:=&quot;Sub-ledger&quot;)
           Set r = rFirst
        Else
           Set r = A.Find(What:=&quot;Sub-ledger&quot;, After:=r)
           If r.Address = rFirst.Address Then Exit Do
        End If
           r.Select
          Selection.End(xlDown).Select
          Do
              Sumtotal = Sumtotal + ActiveCell
              ActiveCell.Offset(1, 0).Select
          Loop Until IsEmpty(ActiveCell)
          
          ActiveCell.Offset(1, 0).Select
          ActiveCell.Value = Sumtotal
          
     Loop
  End Sub
  </code></pre>
  <p><a href="https://i.stack.imgur.com/FavBr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FavBr.jpg" alt="enter image description here" /></a></p>