ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA question - Combo box showing result of filtering (https://www.excelbanter.com/excel-programming/295359-vba-question-combo-box-showing-result-filtering.html)

ajliaks[_8_]

VBA question - Combo box showing result of filtering
 
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

--
Message posted from http://www.ExcelForum.com


Bob Flanagan

VBA question - Combo box showing result of filtering
 
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


"ajliaks " wrote in message
...
Hi,

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

Thanks.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com