title: Search from Excel combobox, returing results to userform
body: <p>I'd like search from a combobox on a userform, returning 2 items from 2 different rows. So far I am using a predetermined location set to return the alternate rows. </p>
  
  <p><strong>My question is about this section:</strong></p>
  
  <pre><code>Private Sub ComboBox1_Change()
      If ComboBox1.Text = Sheet1.Cells(3, 1) Then
          oHousing.Text = Sheet1.Cells(3, 2)
          oMeal.Text = Sheet1.Cells(3, 3)
      End If
  End Sub
  </code></pre>
  
  <hr>
  
  <p><strong>Here is what the pseudocode would do:</strong></p>
  
  <ol>
  <li>User selects item in combobox</li>
  <li>combobox will search <code>A1:A99</code> for item</li>
  <li>then once item is found it will output <code>B#</code> and <code>C#</code> (<code>#</code> is based on location of <code>A#</code>)</li>
  <li><code>B#</code> is outputted to <code>oHousing</code> (textbox)</li>
  <li><code>C#</code> is outputted to <code>oMeal</code> (textbox)</li>
  </ol>
  
  <hr>
  
  <p><strong>On my sheet I have:</strong></p>
  
  <ul>
  <li><code>A2:A28</code> with random text (I used ABC's)</li>
  <li><code>B2:B28</code> are random 3 digit numbers (numeric, eg: 001-999)</li>
  <li><code>C2:C28</code> is Random 3 numbers (numeric, eg: 001-999)</li>
  </ul>
  
  <hr>
  
  <p><strong>Here's the rest of my code:</strong></p>
  
  <pre><code>'Finds the difference in 2 known dates (returns whole number in textbox)
  Private Sub CommandButton1_Click()
      Dim firstDate As Date, secondDate As Date, n As Integer
      firstDate = DateValue(sDate.Text)
      secondDate = DateValue(EDate.Text)
      n = DateDiff("d", firstDate, secondDate) - 0.5
      dTotal.Text = n
  End Sub
  
  Private Sub CommandButton2_Click()    'Exit the userform (PerDiem)
      Unload PerDiem
  End Sub
  </code></pre>
  
  <p>Thanks to all in advance!</p>