A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

VB to filter a list



 
 
Thread Tools Display Modes
  #1  
Old June 12th, 2004, 10:55 PM
CrankyLemming
external usenet poster
 
Posts: n/a
Default VB to filter a list

Hi

I have a worksheet containing a list of businesses, their addresses,
phone numbers, and so on, and also a column which specifies the type
of organisation: sports shop, cafeteria, phone shop, etc.

On a form I have a pair of comboboxes. I want ComboBox1 to act in the
same way as the data filter facility on the sheet. So in its default
state, ComboBox2 gives a list of every company. However, if the 'Phone
Shop' option was selected on CB1, then the available list in ComboBox2
would just be of those stores.

Please can anyone advise on how to do this?

Thanks in advance

Steve
  #2  
Old June 13th, 2004, 12:02 AM
Earl Kiosterud
external usenet poster
 
Posts: n/a
Default VB to filter a list

Steve,

The Autofilter already works in the way you describe. If you've selected a
value from a field, other field's dropdowns show only available values.
Maybe it will work for your application.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"CrankyLemming" wrote in message
m...
Hi

I have a worksheet containing a list of businesses, their addresses,
phone numbers, and so on, and also a column which specifies the type
of organisation: sports shop, cafeteria, phone shop, etc.

On a form I have a pair of comboboxes. I want ComboBox1 to act in the
same way as the data filter facility on the sheet. So in its default
state, ComboBox2 gives a list of every company. However, if the 'Phone
Shop' option was selected on CB1, then the available list in ComboBox2
would just be of those stores.

Please can anyone advise on how to do this?

Thanks in advance

Steve



  #3  
Old June 13th, 2004, 08:34 AM
CrankyLemming
external usenet poster
 
Posts: n/a
Default VB to filter a list

"Earl Kiosterud" wrote:

Steve,

The Autofilter already works in the way you describe. If you've selected a
value from a field, other field's dropdowns show only available values.
Maybe it will work for your application.


Hi

Thanks for replying.

It doesn't work. I've tried to have ComboBox1 'fill' the a cell which
has an autofilter set already, but the available list then given in
ComboBox2 is still all the businesses.

Steve
  #4  
Old June 13th, 2004, 11:34 AM
Dave Peterson
external usenet poster
 
Posts: n/a
Default VB to filter a list

Debra Dalgleish has some techniques for doing this with data|validation.

You could adapt it to work with comboboxes.



CrankyLemming wrote:

"Earl Kiosterud" wrote:

Steve,

The Autofilter already works in the way you describe. If you've selected a
value from a field, other field's dropdowns show only available values.
Maybe it will work for your application.


Hi

Thanks for replying.

It doesn't work. I've tried to have ComboBox1 'fill' the a cell which
has an autofilter set already, but the available list then given in
ComboBox2 is still all the businesses.

Steve


--

Dave Peterson

  #5  
Old June 13th, 2004, 10:56 PM
CrankyLemming
external usenet poster
 
Posts: n/a
Default VB to filter a list

Dave Peterson wrote:
Debra Dalgleish has some techniques for doing this with data|validation.

You could adapt it to work with comboboxes.


Thanks for the nod. I'll have a look & see what comes of it.

S
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:46 AM.


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