Hello,
I would fix the code when select NAME from combobox and match with column C should show a ll of data in listbox for the name.
the code has problem , will not show TOTAL row and when show data are not arranged , also I would populate names in combobox 1 fo all of names in column C without duplicates , empty . here is the code .
Private Sub cbxEAName_Change()
Dim empfound As Range, firstAddress
Dim shData As Worksheet
Set shData = ThisWorkbook.Sheets("SPLITTING")
Dim rng As Range
Set rng = shData.Range("C2:C" & shData.Range("A" & shData.Rows.count).End(xlUp).Row)
With ListBox1
.Clear
.ColumnCount = 7
.ColumnWidths = "90;100;100;100;100;100;100"
'.TopIndex = 0
Set empfound = rng.Find(cbxEAName.Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not empfound Is Nothing Then
firstAddress = empfound.Address
Do
.AddItem shData.Cells(empfound.Row, "A").Value
.List(.ListCount - 1, 1) = shData.Cells(empfound.Row, "B").Value
.List(.ListCount - 1, 2) = shData.Cells(empfound.Row, "C").Value
.List(.ListCount - 1, 3) = shData.Cells(empfound.Row, "D").Value
.List(.ListCount - 1, 4) = shData.Cells(empfound.Row, "E").Value
.List(.ListCount - 1, 5) = shData.Cells(empfound.Row, "F").Value
.List(.ListCount - 1, 6) = shData.Cells(empfound.Row, "G").Value
Set empfound = rng.FindNext(empfound)
Loop While Not empfound Is Nothing And empfound.Address <> firstAddress
End If
End With
End Sub
Bookmarks