title: VBA Create search results in userform listbox
body: <p>I am trying to create a userform that displays results in a listbox if textbox1 and textbox2's value matches cell value </p>
  
  <p>Textbox1 will = cell value I1
  Textbox2 value will be yes, no, maybe (whatever is in cell H1)</p>
  
  <p>the listbox results will then return i.e Column A Data Mon, Tues, etc and all the Yes results in column below cell c3, I can only return the value in c3</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
  Dim myString
  
  Sheets("Sheet1").Select
  Range("I1").Select
  myString = Range("I1")
  
  UserForm1.TextBox1.Text = myString
  
  Sheets("Sheet1").Select
  Range("H1").Select
  myString = Range("H1")
  
  UserForm1.TextBox2.Text = myString
  
  Dim rng As Range
  Dim ws As Worksheet
  Dim i As Integer
  
  Set ws = Worksheets("Sheet1")
  Set rng = ws.Range("B3:G3")
  Set fnd = rng.Find(TextBox1)
  If fnd Is Nothing Then MsgBox TextBox1 &amp; " not found": Exit Sub
  Set first = fnd
  With ListBox1
      .Clear
      .AddItem fnd.Offset(, 0)
      .List(.ListCount - 1, 1) = fnd.Offset(, -1)
      .List(.ListCount - 1, 2) = fnd.Offset(, 1)
  
  
      Do
          Set fnd = rng.FindNext(fnd)
          If fnd.Address = first.Address Then Exit Do
              .AddItem fnd.Offset(, 0)
              .List(.ListCount - 1, 1) = fnd.Offset(, -1)
              .List(.ListCount - 1, 2) = fnd.Offset(, 1)
  
      Loop
      End With
      End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/D5qEw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D5qEw.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/BlFBT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BlFBT.jpg" alt="enter image description here"></a></p>