Hi,
The following code was written to search 12 sheets and put results in a sheet called "Summary Sheet"
Sub test2()
Dim SHTNM As String
Dim R As Long
Dim Z As String
Application.ScreenUpdating = False
R = 2 ' Summary Row to start paste of InProd rows from other sheets
Sheets("Source").Range("A1").Value = InputBox("What do you like to search")
Z = Sheets("Source").Range("A1").Value
For sht = 1 To 12 ' sheets ( 1 to 12) production sheets
SHTNM = "ProdLine" & sht
Sheets(SHTNM).Select
With Sheets(SHTNM).Range("A:A", Range("A100").End(xlUp).Address)
Set c = .Find(Z, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Sheets(SHTNM).Range(c.Address).EntireRow.Copy
Sheets("Summary").Cells(R, 1).Insert Shift:=xlDown
R = R + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next sht
Sheets("Summary").Select
End Sub
this might help you.
Jaz
Bookmarks