السلام عليكم
الكود في حدث الورقة DocLog
كالتالي
[code]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$2" Then 'move
a = [d2]
Range("$8:$424").AutoFilter Field:=11, Criteria1:=a
Range([K8].End(xlDown), [A1000].End(xlUp)).Select
Selection.Copy
Sheets("Move").[A10000].End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Selection.EntireRow.Delete Shift:=xlUp
Application.CutCopyMode = False
Exit Sub
Else
If Target.Address = "$F$2" Then 'copy
a = [F2]
Range("$8:$424").AutoFilter Field:=11, Criteria1:=a
Range([K8].End(xlDown), [A1000].End(xlUp)).Copy
Sheets("Copy").[A10000].End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Else
Exit Sub
End If
End If
End Sub
ومرفق الملف أيضا
CopyMove.rar