Populate combobox with visable rows only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combobox where the rowsource property refers to a range on a worksheet

i.e. Sheet1!A:

However, I am using Autofilter to reduce this list. I would like only the visable rows on
Sheet1 to populate the rowsource property but it currently includes the hidden ones

Any ideas

Max
 
You would have to remove the rowsource property and load the box with code
using additem. An alternative would be to copy the filtered data to another
location and point the rowsource at that.

there really is no reason to point the whole column. In the initialize
event

Private Sub Userform_Initialize()
With Worksheets("Sheet1")
set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End With
ComboBox1.RowSource = rng.Address(external:=True)
End sub
 

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

Similar Threads


Back
Top