Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Still stuck removing duplicate values
The below code populates a listbox for me, but i want ONLY unique values listed, currently i am
getting a few duplicate values populating in the listbox. How can i remove them to ONLY display 1 value of the duplicate values ? Private Sub ListBox1_Change() Application.ScreenUpdating = False If ComboBox1.ListCount 0 Then ComboBox1.Clear Dim LastCell As Long Dim myrow As Long On Error Resume Next LastCell = Worksheets("Contact List").Cells(Rows.Count, "A").End(xlUp).Row With ActiveWorkbook.Worksheets("Contact List") ..Select 'first thing to do with a With statement that occurs on a second sheet For myrow = 1 To LastCell If .Cells(myrow, 1) < "" Then If .Cells(myrow, 1).Offset(0, 1).Value = ListBox1.Value Then ComboBox1.AddItem Cells(myrow, 1) End If End If Next End With Application.ScreenUpdating = True End Sub Corey.... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removing Duplicate Values | Excel Discussion (Misc queries) | |||
Removing duplicate entries | New Users to Excel | |||
removing duplicate entries | Excel Discussion (Misc queries) | |||
Removing Duplicate Rows | Excel Discussion (Misc queries) | |||
Removing duplicate values in a column | Excel Worksheet Functions |