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

برجاء تعديل الكود التالى للاستاذ lionheart فى البحث و اظهار البيانات فى الليست بوكس


الصفتى
إذهب إلى أفضل إجابة Solved by حسونة حسين,

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

    Dim x, ws As Worksheet, i As Long, j As Long, lastRow As Long
    With Me.ListBox1
        .Clear
        .ColumnCount = 7
        .ColumnWidths = "60 pt;150 pt;80 pt;150 pt;100 pt;70 pt;100 pt"
        .ColumnHeads = 0
        Set ws = Sheets("Ledger")
        x = Application.Match(ComboBox1.Value, ws.Rows(1), 0)
        If Not IsError(x) Then
            lastRow = ws.Cells(Rows.Count, "B").End(xlUp).Row
            For i = 1 To lastRow
                If TextBox1 <> "" And InStr(ws.Cells(i, x), TextBox1) <> 0 Then
                    .AddItem
                    .List(j, 0) = ws.Cells(i, 1)
                    .List(j, 1) = ws.Cells(i, 3)
                    .List(j, 2) = ws.Cells(i, 4)
                    .List(j, 3) = ws.Cells(i, 16)
                    .List(j, 4) = ws.Cells(i, 17)
                    .List(j, 5) = ws.Cells(i, 18)
                    .List(j, 6) = ws.Cells(i, 10)
                    j = j + 1
                End If
            Next i
        End If
    End With

المطلوب عند البحث باسخدام الكمبوبوكس و التكست بوكس يتم اظهار النتائج الموجوده فى شيت ليدجر فى النطاق من (a4:s ) و لكم جزيل الشكر

test.xlsb

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

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