LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Duplicate Values James Excel Discussion (Misc queries) 1 January 7th 10 01:14 PM
Removing duplicate entries Roger Bell New Users to Excel 2 June 23rd 07 10:20 AM
removing duplicate entries armagan Excel Discussion (Misc queries) 1 June 12th 06 05:42 PM
Removing Duplicate Rows bvinternet Excel Discussion (Misc queries) 1 July 23rd 05 09:26 PM
Removing duplicate values in a column natan Excel Worksheet Functions 2 November 22nd 04 06:48 AM


All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"