将列值添加到组合框,但是如何跳过重复项?

时间:2018-11-07 18:49:37

标签: excel vba excel-vba

我真的需要您的帮助,因为我相信这个令人困惑的问题还有很多。我正在使用基本的for循环从A列中获取所有列值,并将其插入到用户表单组合框(地板)中。

如何修改下面的函数,使其仅将unueue值添加1次,而不是每次都复制列值:

enter image description here

Sub tester()

    With Sheets("Office Spaces")

        lRow = Cells(Rows.Count, 1).End(xlUp).row

        For i = 3 To lRow

            If Not IsEmpty(.Cells(i, 1).Value) Then

                Me.floor.AddItem .Cells(i, 1).Value

            End If

        Next i

    End With

End Sub

所需的结果如下所示: enter image description here

0 个答案:

没有答案
相关问题