Sorry, use it like this:
sub macro_1()
call macro_find_all_wbs("C:\path","Searchtext")
end sub
Sub macro_find_all_wbs(dir_path As String, search_text As String)
Dim fso, fol, fil, wb1, wb2, sh1, sh2, fnd_rng, count_row
Set wb1 = ActiveWorkbook
Set sh1 = wb1.ActiveSheet
Set fso = CreateObject("Scripting.filesystemobject")
Set fol = fso.getfolder(dir_path)
For Each fil In fol.Files
Set wb2 = Workbooks.Open(fil)
For Each sh2 In wb2.Sheets
Set fnd_rng = sh2.Cells.Find(search_text)
Do Until fnd_rng Is Nothing Or rnd_rng.Row < count_row
fnd_rng.EntireRow.Copy sh1.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
count_row = fnd_rng.Row
Set fnd_rng = sh2.Cells.FindNext(rnd_rng)
Loop
Next
Next
End Sub
Bookmarks