Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2018, 08:15 PM
trevorc trevorc is offline Adding a check box to  filter criteria Windows 7 32bit Adding a check box to  filter criteria Office 2013
Competent Performer
Adding a check box to  filter criteria
 
Join Date: Jan 2017
Posts: 174
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
  #2  
Old 11-13-2018, 07:34 AM
NoSparks NoSparks is offline Adding a check box to  filter criteria Windows 7 64bit Adding a check box to  filter criteria Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

could do it this way
Attached Files
File Type: xlsm TrevorC_Filter_v2.xlsm (27.3 KB, 14 views)
Reply With Quote
  #3  
Old 11-13-2018, 10:31 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Adding a check box to  filter criteria Windows 7 64bit Adding a check box to  filter criteria Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

@trevorc
I took the liberty of creating a new thread with your "follow-up " question.
If another member had the same problem and your new question had stayed in the previous thread he would not have found it, as members usually check the thread titles only.
So, it's always best to create a new thread (with a descriptive title as you always do) with, eventually, a link to all pertaining threads when you have a "new" question in an existing thread.
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #4  
Old 11-13-2018, 12:19 PM
trevorc trevorc is offline Adding a check box to  filter criteria Windows 7 32bit Adding a check box to  filter criteria Office 2013
Competent Performer
Adding a check box to  filter criteria
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

Thanks, for the awesome effort you have put in, it's exactly what I needed
Reply With Quote
Reply



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
Adding a check box to  filter criteria How to modify code for Auto filter based on two criteria ... LearnerExcel Excel Programming 13 02-14-2018 08:20 PM
Adding a check box to  filter criteria 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft