Hi people.
Can anyone help me please? I want that the Combox1 don't show the duplicated values. Thanks
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address <> "$C$1" Then Exit Sub
rws = ActiveSheet.UsedRange.Columns(1).Rows.Count
ComboBox1.Clear
Set r = Range(Cells(2, 1), Cells(rws, 1))
For Each c In r.Cells
y = Application.WorksheetFunction.CountIf(Range(Cells(1, 1), Cells(c.Row, 1)), c)
If y = 1 Then ComboBox1.AddItem c
Next c
With ComboBox1
.Activate
.Application.SendKeys ("%{down}")
End With
End Sub
Bookmarks