![]() |
|
#1
|
|||
|
|||
|
Back Again,
I got the code below to work ok, but Is it possible to add a check box to the criteria list so only the items checked are selected for the filter. See the updated attached file for an example of what I'd like to be able to do. I'm sure it's just an addition to the criteria but haven't found anything online on how to do it. Code:
Sub Filter_Closed()
t = ActiveSheet.Shapes("fltr").TextFrame.Characters.Text
If ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Filter Closed" Then
ActiveSheet.ListObjects("Clipsal_Customers").Range.AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Sheets("Automation Data").Range("I5", Sheets("Automation Data").Range("I24"))
ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Show All"
Exit Sub
Else
ActiveSheet.ListObjects("Clipsal_Customers").Range.AutoFilter Field:=3
ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Filter Closed"
End If
End Sub
Last edited by Pecoflyer; 11-13-2018 at 10:33 AM. Reason: Add link |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Auto Filter data based on Cell E1 text as Criteria? | LearnerExcel | Excel Programming | 1 | 03-10-2018 01:36 PM |
How to modify code for Auto filter based on two criteria ...
|
LearnerExcel | Excel Programming | 13 | 02-14-2018 08:20 PM |
Filter Mail Merge based on a list of filter criteria
|
AusSteelMan | Mail Merge | 2 | 05-09-2016 03:35 PM |
| Filter tasks with multiple criteria | markhad | Outlook | 0 | 03-15-2016 02:48 AM |
| Forgotten Sort and Filter Criteria | rbdmg | Mail Merge | 0 | 10-31-2011 09:14 PM |