View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default ListBoxes - RowSource

Not sure what to put in place of 'your code yet ... but I'll give it a try

If you have a listbox on a userform you can use this event in the
userform module

Private Sub UserForm_Initialize()
Dim cell As Range
For Each cell In Range("A1:A100").SpecialCells(xlCellTypeVisible)
Me.ListBox1.AddItem cell.Value
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message ...
Thanks for the pointer Ron
Not sure what to put in place of 'your code yet ... but I'll give it a try



"Ron de Bruin" wrote in message ...
Hi

You can also fill your listboxes with code and loop through the visible cells in the range

For Each cell In Range("A1:A100").SpecialCells(xlCellTypeVisible)
'your code
Next



--
Regards Ron de Bruin
http://www.rondebruin.nl



"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message ...
I am trying to find a way to use a filtered range as the Rowsource for a listbox
I hoped to use AutoFilter to provide the data but it doesn't seem appropriate.
Will I have to copy the filtered data to another area on the worksheet ?
... or is there a better way to achieve the desired result ?


Regards & TIA