Hi I have the following code below, im not sure how to modify it to make it only search 2 columns of information, how can do this?
thanks
thanks
Code:
Private Sub CommandButton3_Click()
Dim StrFindWhat As Range
Dim NextCell As Range
Dim WhatToFind As Variant
WhatToFind = Application.InputBox("Please enter the Application or Service you want to search for?", "Search", , 500, 80, , , 2)
If WhatToFind <> "" And Not WhatToFind = False Then
For Each oSheet In ActiveWorkbook.Worksheets
oSheet.Activate
oSheet.[b4].Activate
Set StrFindWhat = Cells.Find(What:=WhatToFind, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
If Not StrFindWhat Is Nothing Then
StrFindWhat.Activate
If MsgBox("Found " & Chr(34) & WhatToFind & Chr(34) & " in " & oSheet.Name & "!" & StrFindWhat.Address, vbOKCancel) = vbCancel Then Exit Sub
On Error Resume Next
While (Not NextCell Is Nothing) And (Not NextCell.Address = StrFindWhat.Address)
Set NextCell = Cells.FindNext(After:=ActiveCell)
If Not NextCell.Address = StrFindWhat.Address Then
NextCell.Activate
If MsgBox("Found " & Chr(34) & WhatToFind & Chr(34) & " in " & oSheet.Name & "!" & NextCell.Address, vbOKCancel) = vbCancel Then Exit Sub
End If
Wend
End If
Set NextCell = Nothing
Set StrFindWhat = Nothing
Next oSheet
End If
End Sub