اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

تجميع البيانات الى خلاصة عامة بحسب رقم الطلبية


إذهب إلى أفضل إجابة Solved by محي الدين ابو البشر,

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

اخي ابو بشير هناك خطاء بسيط في الكود عندما اضع رقم الطلبية مثلا 100 وعدد اصنافها اكثر من الطلبية 102 فان الخلايا في الاعمدة من B الى E تبقى الارقام فيها ولاتنحذف عندما اختار رقم الطلبية الاقل اصناف

رابط هذا التعليق
شارك

تفضل

Private Sub Worksheet_Change(ByVal Target As Range)
Dim a, No, w
Dim i&
a = Sheets("ÞÇÚÏÉ ÇáÈíÇäÇÊ").Cells(1).CurrentRegion
Application.ScreenUpdating = False
If Not Intersect(Target, Cells(1, 9)) Is Nothing Then
Me.Range(Cells(2, 2), Cells(2, 2).End(-4121).Cells).Offset(, -1).Resize(, 4).ClearContents
        With CreateObject("scripting.dictionary")
            For i = 3 To UBound(a)
                If a(i, 1) = Target.Value Then
                    If Not .Exists(a(i, 1) & a(i, 3)) Then
                        .Add (a(i, 1) & a(i, 3)), Array(a(i, 3), a(i, 4), a(i, 5), a(i, 6))
                Else
                        w = .Item(a(i, 1) & a(i, 3))
                        w(0) = w(0): w(1) = w(1) + a(i, 4)
                        w(2) = w(2) + a(i, 5): w(3) = w(3) + a(i, 6)
                        .Item(a(i, 1) & a(i, 3)) = w
                End If
            End If
Next
Me.Cells(2, 1).Resize(.Count, 4) = Application.Index(.items, 0, 0)
    End With
End If
Application.ScreenUpdating = True
End Sub

عملياً فقط تغيير

Me.Range(Cells(2, 2), Cells(2, 2).End(-4121).Cells).Offset(, -1).Resize(, 4).ClearContents

 

رابط هذا التعليق
شارك

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