View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Populate combobox with visable rows only

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

--
Regards,
Tom Ogilvy


"max" wrote in message
...
I have a combobox where the rowsource property refers to a range on a

worksheet.

i.e. Sheet1!A: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