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: 1
Default Excel Combobox with additional selection criteria


I have a combobox that reflects a list (in a different tab) withou
duplications.

At the moment it is selecting names in columnC. Additionally, I want t
show only those names that meet a criteria in columnA. The selectio
criteria is entered in cell M1 of the base sheet.

Here's my code I use so far.

Private Sub worksheet_Activate()
Dim AllCells As Range, Cell As Range
Dim NoDupes As New Collection
Dim i As Integer, j As Integer
Dim Swap1, Swap2, Item
Dim rng As Range

Me.combobox1.Clear

Set AllCells = Worksheets("NKADaten").Range("C4:C200")
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
On Error GoTo 0
For i = 1 To NoDupes.Count - 1
For j = i + 1 To NoDupes.Count
If NoDupes(i) NoDupes(j) Then
Swap1 = NoDupes(i)
Swap2 = NoDupes(j)
NoDupes.Add Swap1, befo=j
NoDupes.Add Swap2, befo=i
NoDupes.Remove i + 1
NoDupes.Remove j + 1
End If
Next j
Next i
For Each Item In NoDupes
Me.combobox1.AddItem Item
Next Item
End Sub

Many thanks for your help.

Sve

--
sven_da
-----------------------------------------------------------------------
sven_dau's Profile: http://www.excelforum.com/member.php...fo&userid=3529
View this thread: http://www.excelforum.com/showthread.php?threadid=56110

 
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
If - additional criteria suddengunfire Excel Discussion (Misc queries) 14 July 31st 08 04:00 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
Bringing additional information in with combo box selection JD Excel Worksheet Functions 1 February 24th 05 01:45 AM
Excel - Copy range of cells based on Combobox Selection Excel-erate2004 Excel Programming 2 April 3rd 04 05:35 PM
Selection change: additional question Maria[_6_] Excel Programming 1 March 2nd 04 12:59 PM


All times are GMT +1. The time now is 12:14 PM.

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

About Us

"It's about Microsoft Excel"