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

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

  • تمت الإجابة
قام بنشر

السلام عليكم

قم بتفعيل الماكرو

الكود

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$G$2" Then
        Dim wsReport As Worksheet
        Dim wsSearch As Worksheet
        Dim lastRow As Long
        Dim i As Long
        Dim searchDate As Date
        
        Set wsReport = ThisWorkbook.Sheets("REPORT")
        Set wsSearch = ThisWorkbook.Sheets("Search2")
        searchDate = wsSearch.Range("G2").Value
        wsSearch.Range("B4:G1000").ClearContents
        lastRow = wsReport.Cells(wsReport.Rows.Count, "D").End(xlUp).Row
        Dim rowIndex As Long
        rowIndex = 4
        For i = 2 To lastRow
            If wsReport.Cells(i, "D").Value = searchDate Then
                wsSearch.Cells(rowIndex, "B").Value = rowIndex - 3
                wsSearch.Cells(rowIndex, "C").Value = wsReport.Cells(i, "G").Value
                wsSearch.Cells(rowIndex, "F").Value = wsReport.Cells(i, "J").Value
                wsSearch.Cells(rowIndex, "D").Value = wsReport.Cells(i, "I").Value
                wsSearch.Cells(rowIndex, "E").Value = wsReport.Cells(i, "H").Value
                rowIndex = rowIndex + 1
            End If
        Next i
    End If
End Sub

New Microsoft Excel Worksheet (1).xlsb

  • Like 1

انشئ حساب جديد او قم بتسجيل دخولك لتتمكن من اضافه تعليق جديد

يجب ان تكون عضوا لدينا لتتمكن من التعليق

انشئ حساب جديد

سجل حسابك الجديد لدينا في الموقع بمنتهي السهوله .

سجل حساب جديد

تسجيل دخول

هل تمتلك حساب بالفعل ؟ سجل دخولك من هنا.

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

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

Important Information