السلام عليكم
اريد تعديل على زر البحث في الفورم بحيث يسترجع البيانات التابعة (ComboBox) الموضحة باللون الاصفر من صفحة اسمها (مخزن) وشكرا الرقم اسري tareq972708
Private Sub CommandButton1_Click()
Dim Arr As Variant
Dim i As Integer, j As Long, LastR As Long
Arr = Array("ÇáÈíÇäÇÊ", "ãÎÒä")
For j = LBound(Arr) To UBound(Arr)
LastRow = Sheets(Arr(j)).Cells(Rows.Count, "B").End(xlUp).Row + 1
For i = 2 To 11
UserForm1.ComboBox1.Clear
For T = 2 To LastRow
If OptionButton1.Value = True Then
If TextBox1.Text = Mid(Sheets(Arr(j)).Cells(T, 2).Text, 1, Len(TextBox1.Text)) Then
UserForm1.ComboBox1.AddItem Sheets(Arr(j)).Cells(T, 3)
UserForm1.Controls("TextBox" & i).Value = Sheets(Arr(j)).Cells(T, i).Value
UserForm1.CommandButton5.Enabled = True
Unload Me
End If
Else
If OptionButton2.Value = True Then
If TextBox1.Text = Mid(Sheets(Arr(j)).Cells(T, 3).Text, 1, Len(TextBox1.Text)) Then
UserForm1.ComboBox1.AddItem Sheets(Arr(j)).Cells(T, 3)
UserForm1.Controls("TextBox" & i).Value = Sheets(Arr(j)).Cells(T, i).Value
UserForm1.CommandButton4.Enabled = True
UserForm1.CommandButton5.Enabled = True
Unload Me
End If
End If
End If
Next
Next
'UserForm1.ComboBox1.ListIndex = 0
Next
If UserForm1.TextBox2.Text = "" Then MsgBox "åÐÇ ÇáØÇáÈ ÛíÑ ãæÌæÏ", vbInformation + vbMsgBoxRight, "äÊíÌÉ ÇáÈÍË"
UserForm1.CommandButton3.Enabled = False
End Sub
رصد العقوبات طلاب الثانوية العامة.rar