View Single Post
 
Old 11-12-2018, 08:15 PM
trevorc trevorc is offline Windows 7 32bit Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 173
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default Adding a check box to filter criteria

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
Edit Mod : this thread relates to https://www.msofficeforums.com/excel...tml#post135417
Attached Files
File Type: xlsm TrevorC_Filter.xlsm (18.6 KB, 9 views)

Last edited by Pecoflyer; 11-13-2018 at 10:33 AM. Reason: Add link
Reply With Quote