VBA之前写的

2022-06-11  本文已影响0人  猛犸象和剑齿虎

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

上一篇下一篇

猜你喜欢

热点阅读