الأخ الفاضل أبو محمد نصري
إليك الكود التالي
Sub Tarhil()
Dim WS As Worksheet, SH As Worksheet
Dim Cell As Range
Dim strCrit As String, FirstDate As Date, EndDate As Date
Dim X As Long
Set WS = Sheet1: Set SH = Sheet2
strCrit = SH.Range("E1").Value
FirstDate = SH.Range("E2").Value
EndDate = SH.Range("E3").Value
X = 6
Application.ScreenUpdating = False
SH.Range("B6:H1000").ClearContents
With WS
For Each Cell In .Range("D5:D" & .Cells(Rows.Count, 4).End(xlUp).Row)
If Cell >= FirstDate And Cell <= EndDate And Cell.Offset(, -1) = strCrit Then
Cell.Resize(, 7).Copy
SH.Cells(X, 2).PasteSpecial xlPasteValues
X = X + 1
End If
Next Cell
End With
SH.Range("A1").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
إليك الملف التالي (إذا أعجبك الحل يرجى تحديد المشاركة كأفضل إجابة ... تقبل تحياتي)
Transfer Data According To Criteria.rar