[vba]Код
Sub u_42()
Application.ScreenUpdating = False
i = Cells(Rows.Count, "a").End(xlUp).Row
If i > 2 Then Range("a3:b" & i).Clear
Application.DisplayAlerts = False
a = Range("b1").Value
If a = "" Then a = ThisWorkbook.Path
e = ThisWorkbook.Name
b = Dir(a & "\*.xls*")
Do While b <> "" And b <> e
Workbooks.Open Filename:=a & b
For f = 1 To Workbooks(b).Sheets.Count
g = Sheets(f).Name
c = ThisWorkbook.Sheets("1").Cells(Rows.Count, "b").End(xlUp).Row + 1
ThisWorkbook.Sheets("1").Range("b" & c) = g
Next
Workbooks(b).Close False
h = Cells(Rows.Count, "a").End(xlUp).Row + 1
Range("a" & h & ":a" & c) = b
b = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
[/vba]