Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-07-2018, 12:52 PM
trevorc trevorc is offline filter using a table list with VBA Windows 7 32bit filter using a table list with VBA Office 2013
Competent Performer
filter using a table list with VBA
 
Join Date: Jan 2017
Posts: 173
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default filter using a table list with VBA

Hi All,


I am trying to improve on some code I have, currently the code below works fine, but if I need to add a condition to the list for the filter I also have to add it to this code. Is it possible to use a table list for the filter?
It also seems to have a problem with Capital letters - with/without requires 2 entries, can I also fix this other than with a list from a table?

Code:
Sub Filter_Closed()
t = ActiveSheet.Shapes("fltr").TextFrame.Characters.Text
     If ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Filter Closed" Then
        ActiveSheet.ListObjects("Customers").Range.AutoFilter Field:=3, _
        Criteria1:=Array("Done, waiting for confirmation of payment", _
        "In Transit", "Received for Repair, Proceed with Repair", _
        "waiting delivery of parts", "Waiting for Email Address", "Waiting for reply from customer", "="), Operator _
        :=xlFilterValues
        ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Show All"
      Exit Sub
      Else
        ActiveSheet.ListObjects("Customers").Range.AutoFilter Field:=3
        ActiveSheet.Shapes("fltr").TextFrame.Characters.Text = "Filter Closed"
      End If
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down list/ filter help with sharepoint DB12345 Misc 0 10-25-2016 02:03 PM
filter using a table list with VBA Filter Mail Merge based on a list of filter criteria AusSteelMan Mail Merge 2 05-09-2016 03:35 PM
filter using a table list with VBA Data validation list filter with range defined by OFFSET Mango123 Excel 4 03-18-2014 02:52 PM
filter according to a list of filters userman Excel 2 06-12-2012 02:19 AM
filter using a table list with VBA Growing Filter List rbdmg Mail Merge 1 10-10-2011 02:56 AM

Other Forums: Access Forums

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


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