Private Sub ComboBox1_Change()
Dim i As Long, ii As Long
Dim NdAry()
Me.ListBox1.Clear
With sss
For i = 2 To .Cells(Rows.Count, "a").End(xlUp).Row
If CStr(Me.ComboBox1) = CStr(.Cells(i, 1)) Then
ii = ii + 1
ReDim Preserve NdAry(1 To 13, 1 To ii)
NdAry(1, ii) = .Cells(i, 11).Value
NdAry(2, ii) = .Cells(i, 14).Value
NdAry(3, ii) = .Cells(i, 23).Value
NdAry(4, ii) = .Cells(i, 24).Value
NdAry(5, ii) = .Cells(i, 25).Value
NdAry(6, ii) = .Cells(i, 17).Value
NdAry(7, ii) = .Cells(i, 18).Value
NdAry(8, ii) = .Cells(i, 19).Value
NdAry(9, ii) = .Cells(i, 3).Value
NdAry(10, ii) = .Cells(i, 26).Value
NdAry(11, ii) = .Cells(i, 27).Value
NdAry(12, ii) = .Cells(i, 29).Value
NdAry(13, ii) = .Cells(i, 66).Value
End If
Next
End With
If ii Then
If ii = 1 Then
Me.ListBox1.Column = NdAry
Else
Me.ListBox1.List = WorksheetFunction.Transpose(NdAry)
End If
Else
MsgBox "ãÚáæãÇÊ åÐÇ ÇáÞíÏ ÛíÑ ãÊæÝÑÉ", vbInformation, "ÇáäÊíÌÉ"
End If
Erase NdAry
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub UserForm_Initialize()
Me.ListBox1.ColumnCount = 13
Me.ComboBox1.List = Range("bd2!$a$2:$a$60000").Value
kh_Form_Zoom Me
-------------------------
هذا الكود عندما قمت بتغيير مكان البحث a إلى عمود آخر لم يعمل الكود