title: Finding multiple instances of value using VBA
body: <p>I am trying to find specific values in a worksheet and pull other info from there. However, sometimes that value occurs multiple times. In those cases I want to sum another set of values that'll be found in the same row as the found value. The code below works well to identify a specific instance of a value and then pull info ( that is the "do stuff" portion), but how would I go about looping it to pull all instances of the value and store their addresses temporarily?</p>
  
  <p>Thanks!</p>
  
  <pre><code>Dim AccountsListLength As Integer
  Dim AccountsLength As Integer
  Dim CurrentAccount As String
  Dim SearchISIN As String
  Dim CurrentAccountPage As Range
  Dim FoundISIN As Range
  Dim i As Integer
  
  SearchISIN = Worksheets("Search").Range("SearchISIN").Value
  AccountsListLength = (Worksheets("DataSheet").Range("AccountList").Count)
  AccountsLength = AccountsListLength - 1
  For i = 0 To AccountsLength - 1
  
      CurrentAccount = Worksheets("DataSheet").Range("AccountList")(i + 2)
      Set CurrentAccountPage = Worksheets(CurrentAccount).UsedRange
      Set FoundISIN = CurrentAccountPage.Find(what:=SearchISIN, LookIn:=xlValues, _                 
          LookAt:=xlPart, MatchCase:=False)
  
  
      If Not FoundISIN Is Nothing Then
  
          'Do stuff
  
      End If
  </code></pre>