Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to populate a list box with data from a column in excel. say
column a sheet 1. the data in the column will have repeated data in it, but i only want this data added once in the listbox. e.g column a could be red blue red yellow blue red red yellow but i only want to display in the ist box red blue yellow I know how to populate a listbox based on a range but cant seem to work this out hope someone can help John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
Each time you pick up a new entry, loop through the listbox entries you already have to see if there is a duplicate. 'Create a For Next Loop to read all the items in the List Box For Item = 0 to ListBox.ListCount - 1 If ListBox.List(Item) < {your next candidate} then (Add the candidate to the list) Exit for else 'Duplicate, do nothing end if Next item |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 23, 12:07*pm, Greg Glynn wrote:
Hi John, Each time you pick up a new entry, loop through the listbox entries you already have to see if there is a duplicate. 'Create a For Next Loop to read all the items in the List Box For Item = 0 to ListBox.ListCount - 1 * If ListBox.List(Item) < {your next candidate} then * *(Add the candidate to the list) * *Exit for * else * *'Duplicate, do nothing * end if Next item thanks, just been thinking i think i would need to use a combo box instead of a list, would the code be much different john |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamically populating a 14-column listbox | Excel Programming | |||
Populating a multi column listbox with ADO Recordset | Excel Programming | |||
Populating Column Headers in a ListBox | Excel Programming | |||
populating a multi-column Listbox | Excel Programming | |||
populating a multi-column Listbox | Excel Programming |