السلام عليكم
تحايلنا بحذف الصفوف ذات القيمة صفر
Sub COPY_ALIDROOS()
On Error Resume Next
Dim W_ALI As Workbook, WB_ALI As Workbook, N_ALI$, CH_ALI$, SH_ALI As Worksheet
Dim T%, R%
Dim X As Range
' Dim S_A
' S_A = Union(SH_ALI.Range("A3:A" & R), SH_ALI.Range("E3:E" & R), SH_ALI.Range("F3:F" & R))
Application.ScreenUpdating = 0
'============================================
' هنا تحط مسار مجلد الملفات التي تريد جلب بياناتها
CH_ALI = "C:\Mine\"
'============================================
N_ALI = Dir(CH_ALI & "\*.xlsx")
Set W_ALI = ThisWorkbook
Do While N_ALI <> ""
Set WB_ALI = Workbooks.Open(CH_ALI & "\" & N_ALI)
For Each SH_ALI In WB_ALI.Worksheets
R = SH_ALI.Cells(Rows.Count, 1).End(xlUp).Row
W_ALI.Activate
'============================================
'(A-E-F)هنا الاعمدة المراد جلب بياناتها هيا حسب طلبك هيا
' إبتداء من السطر الثالث
If SH_ALI.Range("C3:C" & R).Value <> 0 Then
Union(SH_ALI.Range("A3:A" & R), SH_ALI.Range("E3:E" & R), SH_ALI.Range("F3:F" & R)).Copy
'============================================
T = Cells(Rows.Count, 1).End(xlUp).Row + 1
ThisWorkbook.Worksheets(1).Range("A" & T).PasteSpecial xlPasteValues
End If
Next SH_ALI
N_ALI = Dir
WB_ALI.Close 0
Loop
With ورقة1
For Each X In .Range("C3:C5000")
If X.Value = 0 Then
X.EntireRow.Delete
End If
Next X
End With
Application.ScreenUpdating = 1
End Sub