الأخ الفاضل طارق
إليك الكود التالي .
Sub Tarhil()
Dim WS As Worksheet, SH As Worksheet
Dim LRWS As Long, LRSH As Long
Dim X As Long, I As Long
Set WS = Sheets("bon de livraison "): Set SH = Sheets("الارشف")
LRWS = WS.Cells(50, 1).End(xlUp).Row
X = Application.WorksheetFunction.CountA(WS.Range("A20:A" & LRWS))
Application.ScreenUpdating = False
For I = 1 To X
LRSH = SH.Cells(Rows.Count, 2).End(xlUp).Row + 1
SH.Cells(LRSH, 2).Value = WS.Range("B17")
SH.Cells(LRSH, 3).Value = WS.Range("B11")
SH.Cells(LRSH, 4).Value = WS.Cells(19 + I, 2).Value
SH.Cells(LRSH, 5).Value = WS.Cells(19 + I, 1).Value
SH.Cells(LRSH, 6).Value = WS.Cells(19 + I, 5).Value
Next I
MsgBox "تم الترحيل بحمد الله", vbInformation, "YasserKhalil"
Application.ScreenUpdating = True
End Sub
وأيضاً إليك الملف المرفق فيه ما طلبت بإذن الله ..
Tarhil YasserKhalil.rar