Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default ListBoxes - RowSource

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default ListBoxes - RowSource

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default ListBoxes - RowSource

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





  #4   Report Post  
Posted to microsoft.public.excel.programming
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with rowsource GMet Excel Programming 4 September 24th 04 02:30 PM
Dropdown Rowsource John C.[_4_] Excel Programming 0 July 28th 04 01:35 AM
Using IF, Then with rowsource? CAA[_23_] Excel Programming 8 April 4th 04 08:56 PM
RowSource Problem Todd Huttenstine[_2_] Excel Programming 1 January 20th 04 04:09 AM
RowSource in ListBox aet-inc[_2_] Excel Programming 1 December 3rd 03 12:41 AM


All times are GMT +1. The time now is 02:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"