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

تصحيح كود البحث ليتم البحث في صفحة محددة


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

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

بسم الله الرحمن الرحيم

السادة الأفاضل مشرفي ورواد المنتدى المحترمين

كل عام وجميع حضراتكم بخير وبصحة وفي أحسن حال

الرجا من سيادتكم التركم لتصحيح كود البحث التالي حتى يتم البحث في صفحة ( شيت ) معين

اسم الشيت المراد البحث فيه هو ( BB ) .

Private Sub TextBox1000_Change()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

If TextBox1000.Value = "" Then ListBox1.Clear: Exit Sub
Dim x As Worksheet
Dim c As Range
ListBox1.Clear
k = 0
For Each x In ThisWorkbook.Worksheets
SS = x.Cells(Rows.Count, 9).End(xlUp).Row
For Each c In x.Range("A9:A" & SS)
b = InStr(c, TextBox1000)
If Trim(c) Like TextBox1000 & "*" Then
ListBox1.AddItem
ListBox1.List(k, 0) = x.Cells(c.Row, 1)
ListBox1.List(k, 1) = c.Worksheet.Name
ListBox1.List(k, 2) = c.Row
k = k + 1
End If
Next c
Next x
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic

End Sub

ولسيادتكم جزيل الشكر والتقدير والعرفان

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

الأستاذ الفاضل : سليم حاصبيا

تحية طيبة

وكل عام وحضرتك بألف خير

اسم الشيت المطلوب البحث فيه (BB) .

وشكرا لحضرتك على الهتمام والرد

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

  • أفضل إجابة

جرب هذا الكود

Option Explicit
Private Sub TextBox1000_Change()

Dim x As Worksheet
Dim c As Range
Dim Arr_Sh, Itm
Dim k%,b%
Arr_Sh = Array("BB")     ''يمكن هنا اضافة اسماء الشيتات التي تريد البحث فيها
If TextBox1000.Value = "" Then ListBox1.Clear: Exit Sub
Dim x As Worksheet
Dim c As Range
ListBox1.Clear
k = 0
For Each Itm In Arr_Sh
     Set x = Sheets(Itm)
     ss = x.Cells(Rows.Count, 9).End(xlUp).Row
     If ss < 9 Then GoTo Next_Item
    For Each c In x.Range("A9:A" & ss)
        b = InStr(c, TextBox1000)
        If Trim(c) Like TextBox1000 & "*" Then
        ListBox1.AddItem
        ListBox1.List(k, 0) = x.Cells(c.Row, 1)
        ListBox1.List(k, 1) = Itm
        ListBox1.List(k, 2) = c.Row
        k = k + 1
        End If
    Next c
Next_Item:
Next Itm

End Sub

 

  • Like 2
  • Thanks 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