I have a search code that searches 1 columb at a time. When it finds the word i type it displays the results in a msgbox. That code works great but it stops running after it finds the first instance of the word. For example if i want to find "Oil filter" and there are more than one row with oil as the first word it stops when it finds oil. Can someone help me with a loop or whatever is needed to keep going until the end. Thanks guys. also i am a noob to vba so please be gentle. And thank you to SMC for writing this code.
Dim rng As Range Dim lngColumns As Long Dim strMessage As String On Error Resume Next Set rng = Columns("e:e").Find(InputBox("Please enter your search parameter.", "Search...", "Text Here")) Err.Clear: On Error GoTo -1: On Error GoTo 0 If Not rng Is Nothing Then For lngColumns = -3 To 3 'This will show the next 6 cells of the row strMessage = strMessage & rng.Offset(, lngColumns).Value & vbCrLf Next lngColumns MsgBox strMessage Else MsgBox "No Match Found!" End If Set rng = Nothing lngColumns = Empty strMessage = vbNullString
Thanks in advance for your help