VBA question - Combo box showing result of filtering

  • Thread starter Thread starter ajliaks
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top