Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I all,
Let me see if i can explain this in a way that will get some help! I have a userform that has a combo box (A) that is filled when the form initializes. Depending on what the user selects it then fills the next combobox (B), my problem arises in that i just want the unique items. No double entries to fill the combo box. A B Grapes Red Flames Peach Yellow Grapes Thompsons Grapes Ruby Reds Peach White The following is some of the code: Private Sub LoadLocation() With lstFieldLocation .Clear Farm = cboFarm.Value For Index = 2 To source.Rows.Count If Farm = source.Cells(Index, 1) Then .AddItem source.Cells(Index, 2) ' Field Location End If Next End With Dim Locations As New Scripting.Dictionary For Index = 2 To source.Rows.Count Loc = source.Cells(Index, "b").Value If Not Locations.Exists(Loc) Then Locations.Add Loc, Loc lstFieldLocation.AddItem Farm End If Next End Sub Please let me know if you need anything else. Thank you so much, Jennifer -- Thank you, Jennifer |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Collection VS Scripting.Dictionary | Excel Programming | |||
Scripting.Dictionary question | Excel Programming | |||
Scripting.Dictionary | Excel Programming | |||
VBA - running scripting dictionary (error!) | Excel Programming | |||
VBA question - Set reference to run Scripting.Dictionary | Excel Programming |