hello
I need help to find out and fixing the problem , I have this code in combobox4 doesn't work despite the same code works with combobox 2,3 The difference is combobox name and column search
Private Sub ComboBox4_Change()
Dim r As Long
If ComboBox4.ListIndex <> -1 Then
ListBox1.Clear
With Worksheets("sheet1").Range("A1:A10000")
For r = 1 To .Rows.Count
If ComboBox4.Value = .Cells(r, 2).Value Then
ListBox1.AddItem .Cells(r, 1).Value
ListBox1.List(ListBox1.ListCount - 1, 1) = .Cells(r, 2).Value
ListBox1.List(ListBox1.ListCount - 1, 2) = .Cells(r, 3).Value
ListBox1.List(ListBox1.ListCount - 1, 3) = .Cells(r, 4).Value
ListBox1.List(ListBox1.ListCount - 1, 4) = .Cells(r, 5).Value
ListBox1.List(ListBox1.ListCount - 1, 5) = .Cells(r, 6).Value
End If
Next r
End With
With ListBox1
.ColumnCount = 6
.ColumnWidths = "150;70;150;90;80;200;0"
End With
End If
End Sub
Thanks