+ Reply to Thread
Results 1 to 6 of 6

Filter by name that contains...

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Filter by name that contains...

    So I just did a "record macro" to get the code below but it wont help me in the future if a new name is added. What I am looking for is how would you alter the code below to filter for anything that contained the word "CUSH" that way if something new came down the pipe I would not have to add another product to the code below.

    Please Login or Register  to view this content.
    Thank you!

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,482

    Re: Filter by name that contains...

    This code should do the trick as a fist step..
    Please Login or Register  to view this content.
    But with a little more context or an example file the selection.autofilter line can be removed / adjusted to fit the apporiate range same as the "Range("$A$1:$AJ$694")" could be replaced with a more flexible range but that depends on how the range is used in the file

  3. #3
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Filter by name that contains...

    How would you use the above expression to filter ALL BUT anything with CUSH in its name??
    Last edited by sungen99; 09-15-2019 at 11:26 AM. Reason: Im an idiot

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Filter by name that contains...

    Criteria1:="<>CUSH*"
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Filter by name that contains...

    Just out of interest why do you need a macro to do what a simple manual Autofilter would achieve
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Filter by name that contains...

    Thank you all for the help.

    Richard, to answer your question, because there are a whole bunch of filtering going on for 15 different sets of data that is then CrossRef and then turned into a master sheet that is then FTP uploaded.

    And the whole thing is NOT being done my me, but another person who knows nothing about excel.

    -Ken

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Inserting filter into pivot table via macro errors if filter doesn't exist.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2018, 10:24 AM
  2. Replies: 0
    Last Post: 08-04-2017, 02:39 AM
  3. VBA Advanced Filter - Two Filters Without Deleting Bottom Filter Data In Same Column Range
    By hysterical.useless in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2017, 02:54 PM
  4. Macro to filter a pivot whilst looping through filter criteria in a variable list.
    By Alistairm88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2015, 04:25 AM
  5. Replies: 6
    Last Post: 10-16-2014, 08:42 AM
  6. Need to filter a report filter based on the previous filter
    By elliotencore in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-28-2014, 07:44 AM
  7. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1