LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to display data in Combobox with no dups


Hi Tom,

Thanks for the help. I tried your suggestion and it works fine, but i
takes a minute or two to perform. I came across another solutio
(below), which takes no time to complete. Still running into a proble
that both solutions seem to have.

When combobox1 is dropped down, sure enough...no dups...working grea
so far ! I dropped down combobox2 and it populates, but not with al
of the selections that I was hoping for. For example. Column A has
cells whos value is "Buffalo". In column B (next to the 5 "Buffalos
is Leona, Evans, Fairfield, Darien Center, and Buffalo Js. When I dro
down Combobox2, I only see Darien Center, Evans and Leona. It seems t
be dropping, or not detecting, the other 2 cells?? Here's the code I'
using. Any ideas or suggestions would be greatly appreciated !!!

Private Sub UserForm_Initialize()
Dim c As Range, D As Object
Set D = CreateObject("Scripting.Dictionary")
For Each c In Sheets("LOC").Range("A2:A3908")
If Not D.Exists(c.Value) Then D.Add c.Value, 1
Next c
regenA.List = Application.Transpose(D.Keys)
End Sub


Private Sub Combobox1_click()
Dim sData As String
sData = regenA.Value
Combobox2.RowSource = ""
Combobox2.Clear
For Each Cell In Worksheets("LOC").Range("A2:A3908")
If LCase(Cell.Offset(0, 1).Value) = LCase(sData) Then
Combobox2.AddItem Cell.Value
End If
Next
End Sub


Ore

--
Ore
-----------------------------------------------------------------------
Oreg's Profile: http://www.excelforum.com/member.php...nfo&userid=919
View this thread: http://www.excelforum.com/showthread.php?threadid=47542

 
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
Combobox display on startup Richard New Users to Excel 5 September 6th 05 01:02 PM
MultiColumn ComboBox Value set/display Jim Zeeb[_2_] Excel Programming 5 June 13th 05 09:20 AM
Display initial value in combobox mworth01[_4_] Excel Programming 5 October 9th 04 08:29 PM
Combobox & Display Bhuktar S[_12_] Excel Programming 1 October 2nd 04 01:14 AM
Format Display in ComboBox King[_4_] Excel Programming 2 October 13th 03 06:06 PM


All times are GMT +1. The time now is 03:12 AM.

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"