اخي الفاضل
تم عمل المطلوب بالمقدور عليه
اضطررت لعمل معادلة في عمود A
وهذا هو الكود
Sub Khboor_Tarheel()
On Error Resume Next
Application.ScreenUpdating = False
For A = 5 To [C200].End(xlUp).Row
If Cells(A, 3) <> "" Then
MySheets = Cells(A, 3)
With Sheets(MySheets).[B200].End(xlUp)
.Offset(1, 0) = Cells(A, 4)
.Offset(1, 1) = Cells(A, 5)
.Offset(1, 2) = Cells(A, 6)
.Offset(1, 3) = Cells(A, 7)
End With
End If
Next A
Application.ScreenUpdating = True
MsgBox "!تم الترحيل بنجاح", vbInformation + vbMsgBoxRight, "تم الترحيل"
Range("C5").Select
Sheets("ورقة1").Activate
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error Resume Next
Dim rngData As Range
Dim rngRow As Range
Set rngData = ورقة1.Range("a5:a1000")
For Each rngRow In rngData.Rows
If Application.WorksheetFunction.CountIf(Sheets("ورقة1").Range("a5:a1000"), Cells(rngRow, 1)) < 0 Then
rngRow.Select
Else
rngRow.Offset(0, 3).Resize(1, 3).ClearContents
End If
Next rngRow
Application.ScreenUpdating = True
Application.EnableEvents = True
On Error GoTo 0
End Sub
وهذا المرفق
مصنف_alidroos.rar