اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

الأخ الفاضل أبو محمد نصري

إليك الكود التالي

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

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information