السلام عليكم
Sub sheet_collec()
For i = 1 To Sheets.Count - 1
Worksheets("" & i).Select
T = 3
Do While T < ActiveSheet.UsedRange.Rows.Count + 1
R1 = Sheets("total").Cells(65000, 1).End(xlUp).Row + 1
Sheets("total").Cells(R1, 1) = ActiveSheet.Cells(T, 2)
If ActiveSheet.Cells(T, 6) = "" Then
Sheets("total").Cells(R1, 2) = 0
Else
Sheets("total").Cells(R1, 2) = ActiveSheet.Cells(T, 6)
End If
If ActiveSheet.Cells(T, 7) = "" Then
Sheets("total").Cells(R1, 3) = 0
Else
Sheets("total").Cells(R1, 3) = ActiveSheet.Cells(T, 7)
End If
T = T + 1
Loop
Application.StatusBar = "يتم الان ترحيل الورقة" & ActiveSheet.Name
Next i
Sheets("total").Select
End Sub
[code]
كود اخر
[code]
Sub sheet_collect2()
TR = 2
For i = 1 To Sheets.Count - 1
Worksheets("" & i).Select
For x = TR To ActiveSheet.UsedRange.Rows.Count
R1 = Sheets("total").Cells(65000, 1).End(xlUp).Row + 1
Sheets("total").Cells(R1, 1) = ActiveSheet.Cells(x, 1)
Next x
Next i
End Sub
my_Opinion.rar