Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Data Validation

Hi Trev

You can use Advanced Filtering to produce a unique items list, or you
could use the following code that produces a collection of unique items
(it uses the value in the cell as the key in the collection.Add method
with an On Error Resume Next which means if that key already exists ie
it's a duplicate, then the code skips over to the next cell).

Sub test()
Dim coll As New Collection, c As Range, i As Long
With Sheets("Info")
On Error Resume Next
For Each c In .Range("A1:A" & .Range("A65536").End(xlUp).Row)
coll.Add c.Value, c.Value
Next c
End With
On Error GoTo 0
For i = 1 To coll.Count
Debug.Print coll(i)
Next
End Sub

Give it whirl! I hope it helps!

Richard


Trever B wrote:
Hi,

Thanks in advance

Need to create a list from a worksheet "Info" Column A

Problem is lots of repeats.

I would like just every diferent entry (No Repeats)

Hope you can help.

Don't no where to start

Thanks

Trev


Reply
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
custom data validation on cells with data validation values AKrobbins Excel Worksheet Functions 2 June 21st 11 04:20 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Programming 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


All times are GMT +1. The time now is 10:34 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"