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


I am trying to filter the contents of a listbox, how can I do that?

[code]Private Sub categorybx_Click()
If categorybx.Value = "Cable" Then
categorybx.AutoFilter Criteria1:="Cable"
If categorybx.Value = "Fiber" Then
categorybx.AutoFilter Criteria1:="Fiber"
If categorybx.Value = "Faceplate" Then
categorybx.AutoFilter Criteria1:="Faceplate"
If categorybx.Value = "Jack" Then
categorybx.AutoFilter Criteria1:="Jack"
If categorybx.Value = "Connector/Coupler" Then
categorybx.AutoFilter Criteria1:="Connector/Coupler"
If categorybx.Value = "Patch Cable" Then
categorybx.AutoFilter Criteria1:="Patch Cable"
If categorybx.Value = "Hardware" Then
categorybx.AutoFilter Criteria1:="Hardware"
If categorybx.Value = "Termination" Then
categorybx.AutoFilter Criteria1:="Termination"
If categorybx.Value = "Electronics" Then
categorybx.AutoFilter Criteria1:="Electronics"
End Su
-------------------

--
musictec
-----------------------------------------------------------------------
musictech's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2485
View this thread: http://www.excelforum.com/showthread.php?threadid=39106

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Autofiltering

I am not sure what your goal is here. It sounds like you want to present a
list of choices, and when the user selects one, leave only the selected item
in the listbox. To do that make sure the ListBox has a LinkedCell somewhere
on the worksheet. Then put this code in your ListBox_Click ().

Private Sub categorybx_Click()
categorybx.Enabled = False
categorybx.ListFillRange = categorybx.LinkedCell
categorybx.Enabled = True
End Sub

This tells the listbox to display a different list, the item chosen from the
original list.
If this is not what you intended, then post back.
Mike F


"musictech" wrote
in message ...

I am trying to filter the contents of a listbox, how can I do that?

[code]Private Sub categorybx_Click()
If categorybx.Value = "Cable" Then
categorybx.AutoFilter Criteria1:="Cable"
If categorybx.Value = "Fiber" Then
categorybx.AutoFilter Criteria1:="Fiber"
If categorybx.Value = "Faceplate" Then
categorybx.AutoFilter Criteria1:="Faceplate"
If categorybx.Value = "Jack" Then
categorybx.AutoFilter Criteria1:="Jack"
If categorybx.Value = "Connector/Coupler" Then
categorybx.AutoFilter Criteria1:="Connector/Coupler"
If categorybx.Value = "Patch Cable" Then
categorybx.AutoFilter Criteria1:="Patch Cable"
If categorybx.Value = "Hardware" Then
categorybx.AutoFilter Criteria1:="Hardware"
If categorybx.Value = "Termination" Then
categorybx.AutoFilter Criteria1:="Termination"
If categorybx.Value = "Electronics" Then
categorybx.AutoFilter Criteria1:="Electronics"
End Sub
--------------------


--
musictech
------------------------------------------------------------------------
musictech's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=24851
View this thread: http://www.excelforum.com/showthread.php?threadid=391066



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofiltering


Mike,

What I have is a list of parts. They are represented in 3 columns.
The first column is the Category. So I will have only a few categorie
but several items that fall under those categories. Next column i
subcategory and the final is a description (or the specific part).
What I have created is a userform with 3 listboxes, and a button calle
insert. My goal is to have the contents of each column listed in th
each listbox. When I select an item from any listbox, I would like i
to filter the other boxes. Normally of course they would start fro
the left at the category box and move to the right. And the categor
box is the only one I would like not to be filtered. I would like i
to always show every category, so you can easily jump into anothe
category.

The insert button is going to be a different story. I am using thi
spreadsheet as a master list, and will not be the spreadsheet I will b
dealing with. So the insert button will be used to copy the selecte
data from the userform into another spreadsheet based on the cell
select to be the starting point. So basically the end user opens
new parts order spreadsheet, selects the first cell in the row the
want to start on, then clicks on a button at the top and start
selecting parts. As he/she hits insert, the parts they select ar
copied into the order in the next available row after the row the
selected.

I hope that clears up things and thanks for your hel

--
musictec
-----------------------------------------------------------------------
musictech's Profile: http://www.excelforum.com/member.php...fo&userid=2485
View this thread: http://www.excelforum.com/showthread.php?threadid=39106

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofiltering


still trying to solve this problem


--
musictech
------------------------------------------------------------------------
musictech's Profile: http://www.excelforum.com/member.php...o&userid=24851
View this thread: http://www.excelforum.com/showthread...hreadid=391066

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
Autofiltering again computexcel Excel Discussion (Misc queries) 6 September 14th 08 09:11 PM
autofiltering Bernie R Excel Worksheet Functions 1 February 7th 08 10:13 PM
Autofiltering Thapelo Excel Worksheet Functions 3 November 5th 07 06:44 AM
AutoFiltering Mennochio Excel Discussion (Misc queries) 1 September 15th 06 08:08 PM
Autofiltering [email protected] Excel Discussion (Misc queries) 2 October 4th 05 02:44 PM


All times are GMT +1. The time now is 10:19 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"