Hi,
I've been using the following code to delete the row of a person who's name is selected from a combo box. It has been working great until recently where names can be duplicated in the list. As a result, When I select a name it is deleting someone else's row. Any suggestions as to how to fix this?
The second part of the code calls on a function I have to display a list of unique names without duplicates in the combo box.![]()
Private Sub CommandButton2_Click() Sheets("PS Scheduler").Range("PSList").Cells(cmbPS.ListIndex + 1, 1).EntireRow.Delete Dim MyUniqueList As Variant, i As Long With Me.cmbPS .Clear ' clear the combobox content MyUniqueList = UniqueItemList(Range("PSList"), True) For i = 1 To UBound(MyUniqueList) .AddItem MyUniqueList(i) Next i .ListIndex = 0 ' select the first item End With End Sub
Thanks!
M
Bookmarks