title: Excel macro to search for value in a column and return a value on the same row from another column in message box
body: <p>I am trying to write a macro that will prompt the user to enter a value and do the following:</p>
  
  <pre><code>- Search for the value in column B and select the first cell where the value is found
  - Return the correspondong value in column L and M of the selected cell's row within a message box
  - Then once the user hits "ok", the macro will find and select the next cell in column B with the search criteria, and repeat the above steps
  - Once all of the cells with the search criteria in column B have been searched and found, a message box will communicate that all matches have been found and close loop 
  </code></pre>
  
  <p>Below is the code I have started out with, and being a beginner with VB, I can't figure out why my loop isn't working correctly... Please help!</p>
  
  <pre><code>    Sub Macro1()
  Dim response As String, FndRow As Long, NoMatch As Boolean, LastRow As Long
  response = InputBox("Please enter the Column Name to find matching Source File Field Name.")
  If response = "" Then Exit Sub
  On Error Resume Next
  Range("B5").Select
  NoMatch = False
  LastRow = 0
  Do Until NoMatch = True
      FndRow = Cells.Find(What:=response, After:=ActiveCell, LookIn:=xlFormulas, _
      LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
      MatchCase:=False, SearchFormat:=False).Row
      If FndRow = 0 Then
          MsgBox response &amp; " could not be found."
          NoMatch = True
      ElseIf FndRow &lt; LastRow Then
          MsgBox "All " &amp; response &amp; " matches have been found."
          NoMatch = True
      Else
          Range("B" &amp; FndRow).Select
          MsgBox "Source File Name: " &amp; Range("L" &amp; FndRow).Value &amp; vbNewLine &amp; "File Column Name: " &amp; Range("M" &amp; FndRow).Value
          LastRow = FndRow
      End If
  Loop
  End Sub
  </code></pre>