【发布时间】:2022-01-06 13:58:11
【问题描述】:
我陷入了这个问题,我必须将数据过滤到组合框中。该列表应该只有唯一的记录。 这是将记录填充到组合框中的代码:
Private Sub UserForm_Activate()
Dim myrng As Range
Dim cl As Range
Dim sh As Worksheet
Set sh = Worksheets("Product_Master")
Set myrng = sh.Range("C2:C100000")
With Me.comBox_Purchase_Product
.Clear
For Each cl In myrng.Cells
If cl.Value <> "" Then
.AddItem cl.Value
End If
Next cl
End With
End sub
这是我得到的产品...现在我只想要唯一的记录并删除所有重复项。
提前致谢。
【问题讨论】:
标签: excel vba combobox duplicates unique