VBA question - Combo box showing result of filtering

A

ajliaks

Hi,

I need to Show, in combo box the list of data contained in a column, i
the same way that excel shows the list when applying autoFilter

Thanks
 
B

Bob Flanagan

one way to do it would be this (untested), assuming the data is in column 1

dim rng1 as range, cell as range
Set rng1 = intersect(activesheet.usedrange,
columns(1).SpecialCells(xlVisible))
userform1.combobox1.clear
for each cell in rng1
userform1.combobox1.additem cell.value
next

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
Top