Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program Unique Values in ComboBox?

Status
Not open for further replies.

CandyS

Technical User
Jun 5, 2003
137
US
How can I set up my combo box to show only unique values in the drop-down list instead of all the repeating values?

Thanks,

Candy
 
Or, if you don't want to put the data anywhere else, you could use

lRow = cells(65536,1).end(xlup).row

for i = 2 to lRow
if cells(i,1).text <> cells(i-1,1).text then
combobox1.additem cells(i,1).text
end if
next i

Assuming list in col A, starting in row 2 (header in 1)
List would have to be sorted for this to work

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top