Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Omitting Duplicate values using a ComboBox or Data Validation

Is it possible to have a ComboBox or a Data Validation list that will omit
duplicate values in the given range?

Regards,
Paul

--



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Omitting Duplicate values using a ComboBox or Data Validation

On Oct 3, 8:17*pm, "PCLIVE" wrote:
Is it possible to have a ComboBox or a Data Validation list that will omit
duplicate values in the given range?

Regards,
Paul

--


In a sheet module

Function UNIQUE(r As Range)
Dim v, a, z
a = r.Value
With CreateObject("scripting.dictionary")
.comparemode = vbTextCompare
For Each v In a
If Not IsEmpty(v) Then
If Not .exists(v) Then .Add v, Nothing
End If
Next
If .Count 0 Then UNIQUE = .keys
End With
End Function
Private Sub Worksheet_Activate()
With Me.ComboBox1
.Clear
.List = Application.Transpose(UNIQUE(Range("A1", Range("a" &
Rows.Count).End(xlUp))))
End With
End Sub

HTH

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
Data Validation Combobox w/autocomplete tamee Excel Discussion (Misc queries) 2 April 10th 07 12:42 PM
Combobox/data validation KneeDown2Up New Users to Excel 1 October 21st 06 01:55 PM
Combobox and data validation GlenC Excel Discussion (Misc queries) 2 September 13th 06 06:52 PM
ComboBox in a Data Validation List... Bob Barnes Excel Discussion (Misc queries) 3 January 6th 06 11:04 PM
data validation vs combobox paul Excel Discussion (Misc queries) 4 October 24th 05 11:42 PM


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