السلام عليكم ورحمه الله وبركاته
لدي هذا الكود الخاص بالبحث داخل عدة شيتات
الكود يعمل بشكل سليم عند البحث عن أسم او نص
!!ولكن عند البحث عن رقم لا يبحث
فيرجي من الخبراء مراجعة الكود واخباري بالسبب
ولكم جزيل الشكر
Sub seach()
Dim sh As Worksheet, rng As Range, x As Byte, a As Byte, d As Long, e As Long, y As Long
Application.ScreenUpdating = False
Set sh = Sheets("Search")
sh.Range("A5:J1000").Clear
Set rng = sh.Range("A2")
x = Sheets.Count
For a = 1 To x
If Sheets(a).Name <> "Search" Then
Sheets(a).Select
d = Cells(1000, 1).End(xlUp).Row + 1
For y = 2 To d
e = sh.Cells(1000, 1).End(xlUp).Row + 1
If rng = Left(Cells(y, 1), Len(rng)) Then
sh.Cells(e, 1) = Sheets(a).Name
sh.Cells(e, 2) = Cells(y, 3).Address
sh.Cells(e, 3) = Cells(y, 1)
sh.Cells(e, 4) = Cells(y, 2)
sh.Cells(e, 5) = Cells(y, 3)
sh.Cells(e, 6) = Cells(y, 4)
sh.Cells(e, 7) = Cells(y, 5)
sh.Cells(e, 8) = Cells(y, 6)
sh.Cells(e, 9) = Cells(y, 7)
sh.Cells(e, 10) = Cells(y, 8)
End If
Next
End If
Next
Sheets("Search").Select
Application.ScreenUpdating = True
End Sub