Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Frustration -- Filtering a list with the click of a Button

Column one in my list consists of data that could either be one of fiv
values. The list is 300 rows long, so each row has either of the fiv
values in column one. My problem is that i wish to have five button
on the SHEET that would allow me to filter that list by the values i
column one. For example, button one will filter the list by one of th
five values. Button two would filter the list by another of the fiv
values. The ultimate result would be to have a button that i click an
the list is filtered automatically. I also want to have a button tha
resets the list so no filters are applied. I DO NOT want t
autofilter, and I've tried advanced filter with no luck. I've trie
searching the web for some VB code i thought i could plug in, but n
luck. I hope somebody out there could be of some help to me....
thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Frustration -- Filtering a list with the click of a Button

Why not use advanced filters controlled by worksheet controls?
Set up the criteria range as say "A5:A6"; Data Range to filter as "A9:A500"
Set up five commandbuttons on the worksheet, and assign some code as follows
to each, changing the value that gets populated into cell A6 (the filter
criteria).

' set this up for each control / value
Private Sub CommandButton1_Click()
Range("A6").Value = 1
Call AppFilter
End Sub

' set this once only
Private Sub AppFilter
ActiveSheet.ShowAllData
Range("A6").Value = 1
Range("A9:A500").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=
_
Range("A5:A6"), Unique:=False
End Sub


Cheers
Nigel

"Bhavin " wrote in message
...
Column one in my list consists of data that could either be one of five
values. The list is 300 rows long, so each row has either of the five
values in column one. My problem is that i wish to have five buttons
on the SHEET that would allow me to filter that list by the values in
column one. For example, button one will filter the list by one of the
five values. Button two would filter the list by another of the five
values. The ultimate result would be to have a button that i click and
the list is filtered automatically. I also want to have a button that
resets the list so no filters are applied. I DO NOT want to
autofilter, and I've tried advanced filter with no luck. I've tried
searching the web for some VB code i thought i could plug in, but no
luck. I hope somebody out there could be of some help to me.....
thanks.


---
Message posted from http://www.ExcelForum.com/



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
click a button create an X Captain Eddie Excel Worksheet Functions 1 July 31st 09 08:01 PM
how can i add $ to formulas with a click of a button to ? hgood Excel Discussion (Misc queries) 2 November 12th 08 09:24 PM
trouble filtering a list. Why isn't column filtering? Pat Excel Worksheet Functions 1 July 18th 05 03:30 PM
VBA button click need help. Need LEN help. Nigel Cummins Excel Programming 4 July 11th 03 08:52 PM
VBA button click need help. Need LEN help. Nigel Cummins Excel Programming 0 July 11th 03 09:53 AM


All times are GMT +1. The time now is 10:33 AM.

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"