Private
Sub
ComboBox1_Change()
Dim
rngDB
As
Range
Dim
rng
As
Range
Dim
firstAddress
As
String
Me
.ListBox1.Clear
With
Sheets(
"Import"
)
Set
rngDB = .Range(.Cells(2, 1), .Cells(2, 2).
End
(xlDown))
With
rngDB.Columns(1)
Set
rng = .Find(What:=DateValue(
Me
.ComboBox1.Value), LookAt:=xlWhole)
If
Not
rng
Is
Nothing
Then
firstAddress = rng.Address
Do
Me
.ListBox1.AddItem rng.Offset(columnOffset:=1).Text
Set
rng = .FindNext(rng)
If
rng
Is
Nothing
Then
Exit
Do
Loop
Until
rng.Address = firstAddress
End
If
End
With
End
With
End
Sub
Private
Sub
UserForm_Initialize()
Dim
i
As
Long
Set
hsh = CreateObject(
"Scripting.Dictionary"
)
With
Sheets(
"Import"
)
For
i = 2
To
.Cells(.Rows.Count, 1).
End
(xlUp).Row
If
Not
hsh.Exists(.Cells(i, 1).Text)
Then
hsh(.Cells(i, 1).Text) = 0
End
If
Next
End
With
Me
.ComboBox1.List = Application.Transpose(hsh.Keys)
End
Sub