|
发表于 2021-1-25 22:43
|
显示全部楼层
本楼为最佳答案
Private Sub ComboBox1_Change()
Set d = CreateObject("scripting.dictionary")
Set d2 = CreateObject("scripting.dictionary")
With Sheets("2")
Hx = .Range("a65536").End(xlUp).Row
arr = .Range("a2:c" & Hx)
End With
For x = 1 To UBound(arr)
If arr(x, 2) = ComboBox1 Then
If Not d.exists(arr(x, 3)) Then
d.Add arr(x, 3), ""
Else
If Not d2.exists(arr(x, 3)) Then d2.Add arr(x, 3), ""
End If
End If
Next
ComboBox2.Clear
ComboBox2.List = d2.keys
End Sub
祝順心,南無阿彌陀佛!
|
|