Sub CopyData() Dim i As Long, j As Long, myPath As String, myName As String, x As Range Dim wb As Workbook, ws As Worksheet, aws As Worksheet Application.ScreenUpdating = False With Application.FileDialog(msoFileDialogOpen) .Title = "Выбор файлов для обработки" .AllowMultiSelect = True .ButtonName = "OK" .Show If .SelectedItems.Count = 0 Then Exit Sub Set aws = ActiveSheet For i = 1 To .SelectedItems.Count Set wb = Workbooks.Open(Filename:=.SelectedItems(i), AddToMRU:=False) For j = 1 To wb.Sheets.Count Set x = wb.Sheets(j).[A:A].Find("Подитоги") If Not x Is Nothing Then wb.Sheets(j).Rows("8:" & x.Row).Copy aws.Cells(Rows.Count, 1).End(xlUp).Offset(1) End If Next wb.Close False Next End With End Sub |