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

كشف حساب عميل باليوزرفورم


Tarekchahine
إذهب إلى أفضل إجابة Solved by lionheart,

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

  • أفضل إجابة

There are not enought details but try the following code study it well and change it to suit your needs

Option Explicit

Private Sub ComboBox1_Change()
    Dim ws As Worksheet, i As Integer, m As Long, r As Long, k As Long
    For i = 2 To 5
        Set ws = ThisWorkbook.Worksheets(i)
        With ws
            m = .Cells(Rows.Count, "D").End(xlUp).Row
            If m <= 1 Then GoTo NXT
            For r = 2 To m
                If .Cells(r, "D").Value = ComboBox1.Value Then
                    With Me.ListBox1
                        If k = 0 Then .ColumnCount = 3
                        .AddItem
                        .List(k, 0) = ws.Cells(r, 1).Value
                        .List(k, 1) = ws.Cells(r, 2).Value
                        .List(k, 2) = ws.Cells(r, 6).Value
                        k = k + 1
                    End With
                End If
            Next r
NXT:
        End With
    Next i
End Sub

 

  • Like 1
  • Thanks 1
رابط هذا التعليق
شارك

استاذ شكرا علي المجهودك 

بس المشكله اذا كانت شيت اكسيل نشطه مبيعات او مشتريات  يعمل الكود علي نفس الصفحه 

فففففففففف.jpg

لو سمحت انا اريد يعمل علي صفحات المبيعات و المشتريات و المرتجع 

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

شكرا استاذ .. لو سمحت عندي سؤال 

لازم يكون كشف الحساب دائن ومدين من المبيعات و المشتريات و المرتجع المبيعات و المشتريات    في الليست بوكس ؟

11111111111111111111111111111111111111111.jpg

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

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