I generally loop through the sheets in book:
Option Explicit
Sub PlayMacro()
Dim Prompt As String
Dim RetValue As String
Dim Rng As Range
Dim RowCrnt As Long
Dim ColCrnt As Long
Dim wksht As Long
Dim wshLoop As WorkSheet
Dim lCopyLoop As Long
Prompt = ""
Do While True
RetValue = InputBox(Prompt & "Give me a value to look for")
If RetValue = "" Then
Exit Sub
End If
For Each wshLoop In ActiveWorkbook.Sheets
If wshLoop.Name <> "Sheet1" Then
With wshLoop
Set Rng = .Columns("A:Z").Find(What:=RetValue, After:=.Range("A1"), LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,MatchCase:=False, SearchFormat:=False)
If Not Rng Is Nothing Then
ColCrnt = Rng.Column
RowCrnt = Rng.Row
Prompt = "I found """ & RetValue & """ on row " & RowCrnt
.Cells(RowCrnt, ColCrnt - 1).Copy Destination:=Sheets("Sheet1").Range("A1")
.Cells(RowCrnt, ColCrnt - 2).Copy Destination:=Sheets("Sheet1").Range("A2")
.Cells(RowCrnt, ColCrnt + 1).Copy Destination:=Sheets("Sheet1").Range("A3")
.Cells(RowCrnt, ColCrnt + 2).Copy Destination:=Sheets("Sheet1").Range("A4")
End If
Prompt = Prompt & vbLf
End With
End If
Next wshLoop
Loop
End Sub
Untested, so may take a little bug-fixing.
Bookmarks