Private Sub ComboBox1_Change()
Dim d, m As Integer, rng1 As Range, k, k1
Set d = CreateObject("scripting.dictionary")
For Each rng1 In Range("b2:b1000")
If rng1.Value = ComboBox1.Value Then
d(rng1) = rng1.Offset(0, 3).Value
End If
Next
k = d.Items
k1 = d.keys
TextBox8.Text = Application.Max(d.Items)
End Sub
网友评论