title: Function to find all matches of a value
body: <p>I need your help.</p>
  
  <p>Sorry, I am really new to VBA but, how do I go about converting or adding onto the Excel function below to loop through all the found matches. Right now it only returns 1 match but i'd like to to have it modified to return all occurrences of a match so that I can input it into my userform for processing later.</p>
  
  <pre><code>Private Sub Search_Click()
  
      With Sheet1
          Set foundCell = .Cells.find(What:="test", After:=.Cells(1, 1), _
          LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _
          SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
      End With
  
  If Not foundCell Is Nothing Then
          MsgBox ("""Match"" found in row " &amp; foundCell.Row)
          form1.location.Value = Cells(foundCell.Row, 1).Value
  Else
          MsgBox ("No match not found")
  End If
  
  End Sub
  </code></pre>