Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Filter Records based on the value selected from a drop-down list b

Hi All -

First let me say that you all have been a great help in the past! :o)

This is a pretty simple question. I've created a drop-down list box in cell
F1 (fed from another sheet), and the values in Range F5:F200 match one of the
values in the list. So - when I select the value in the list-box, I need the
worksheet to automatically filter out the rows that do not match the list-box
value.

Appreciate the help!
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Filter Records based on the value selected from a drop-down list b

Hi John

Place this event code in the code sheet for the desired sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$1" Then
Range("F4:F200").AutoFilter Field:=1, Criteria1:=Target.Value,
Operator:=xlAnd
End If
End Sub

Regards,
Per

"Brenner" skrev i meddelelsen
...
Hi All -

First let me say that you all have been a great help in the past! :o)

This is a pretty simple question. I've created a drop-down list box in
cell
F1 (fed from another sheet), and the values in Range F5:F200 match one of
the
values in the list. So - when I select the value in the list-box, I need
the
worksheet to automatically filter out the rows that do not match the
list-box
value.

Appreciate the help!
John


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Filter Records based on the value selected from a drop-down li

That works great! One quick question...

If I add the text "All" to the top of the drop-down list - what do I add to
your code to get everything to "redisplay"?

Thanks!
John

"Per Jessen" wrote:

Hi John

Place this event code in the code sheet for the desired sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$1" Then
Range("F4:F200").AutoFilter Field:=1, Criteria1:=Target.Value,
Operator:=xlAnd
End If
End Sub

Regards,
Per

"Brenner" skrev i meddelelsen
...
Hi All -

First let me say that you all have been a great help in the past! :o)

This is a pretty simple question. I've created a drop-down list box in
cell
F1 (fed from another sheet), and the values in Range F5:F200 match one of
the
values in the list. So - when I select the value in the list-box, I need
the
worksheet to automatically filter out the rows that do not match the
list-box
value.

Appreciate the help!
John



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Filter Records based on the value selected from a drop-down li

Hi John

Thanks for your reply.

Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$1" Then
If Target.Value = "All" Then
Range("F4:F200").AutoFilter
Else
Range("F4:F200").AutoFilter Field:=1, Criteria1:=Target.Value,
Operator:=xlAnd
End If
End If
End Sub

Regards,
Per

On 18 Nov., 22:11, Brenner wrote:
That works great! One quick question...

If I add the text "All" to the top of the drop-down list - what do I add to
your code to get everything to "redisplay"?

Thanks!
John



"PerJessen" wrote:
Hi John


Place this event code in the code sheet for the desired sheet:


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$1" Then
* * Range("F4:F200").AutoFilter Field:=1, Criteria1:=Target.Value,
Operator:=xlAnd
End If
End Sub


Regards,
Per


"Brenner" skrev i meddelelsen
...
Hi All -


First let me say that you all have been a great help in the past! :o)


This is a pretty simple question. I've created a drop-down list box in
cell
F1 (fed from another sheet), and the values in Range F5:F200 match one of
the
values in the list. So - when I select the value in the list-box, I need
the
worksheet to automatically filter out the rows that do not match the
list-box
value.


Appreciate the help!
John- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


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
how do i filter dependents already selected in drop down list fras_too Excel Discussion (Misc queries) 0 December 8th 09 01:33 PM
FILTER FUNCTION DOES NOT SHOW TOTAL RECORDS SELECTED MUSANDAI Excel Worksheet Functions 2 October 18th 07 05:04 PM
Drop down lists that auto create and then filter the next drop down list [email protected] Excel Worksheet Functions 2 September 30th 07 11:53 AM
Extracting selected records from longer list Heidi Excel Discussion (Misc queries) 3 November 8th 06 05:51 PM
Select part numbers from a list; calculate statistics from selected records L Mehl Excel Programming 2 September 11th 04 05:24 PM


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

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

About Us

"It's about Microsoft Excel"