Re: VBA Help needed to tweak my Search and Find macro...
like this?
Code
Sub FindInLists()
'
' Select FindInLists Macro
'
Dim SheetsToSearch
Dim x As String
Dim ws As Worksheet
Dim r As Range
Dim strKeyword As String
SheetsToSearch = Array("List1", "List2", "List3") '// Enter the exact sheet names of sheets to be searched
x = InputBox("What do you want to search for?", "Search")
If x = "" Then
'User cancelled
Exit Sub
End If
For Each ws In ThisWorkbook.Sheets
If Not IsError(Application.Match(ws.Name, SheetsToSearch, 0)) Then
With ws.Range("A1:AB5000")
Set r = .Find(what:=x, After:=.Range("A1")) 'find the cell whose value is equal to x and activate it
If Not r Is Nothing Then
ws.Activate: r.Activate
Exit Sub
End If
End With
End If
Next
End Sub
Display More