Private Sub UserForm_Activate()
''''''''''''''''''''''''''''''''''''''
With Me.ListBox1
.ColumnWidths = "100,100,50,50,50,50"
End With
Dim collon_d As Collection
Set collon_d = New Collection
'====================================================
For Each dd In data1.Range("f5:f" & data1.Range("f" & Rows.Count).End(xlUp).Row)
On Error Resume Next
collon_d.Add dd.Value, dd.Text
Next dd
For g = 1 To collon_d.Count
ListBox2.AddItem
ListBox2.List(g - 1, 0) = collon_d.Item(g)
Next
End Sub
Private Sub CommandButton11_Click()
ListBox1.Clear
Dim ws As Worksheet: Set ws = data1
With Me.ListBox2
For gg = 0 To .ListCount
With Me.ListBox1
For a = 5 To 39
On Error Resume Next
If ListBox2.List(gg, 0) = Cells(a, "f") Then
.AddItem
.List(.ListCount - 1, 0) = ListBox2.List(gg, 0)
.List(.ListCount - 1, 1) = Cells(a, "d")
' .List(.ListCount - 1, 0) = collon_d.Item(g)
' .List(.ListCount - 1, 1) = collon_d2.Item(a)
End If: Next a: End With
Next gg: End With
End Sub