+ Reply to Thread
Results 1 to 6 of 6

is there a way to tell Filtering to Keep only certain fields instead of only removing them

  1. #1
    Registered User
    Join Date
    04-29-2017
    Location
    Midwest
    MS-Off Ver
    Office 365
    Posts
    32

    is there a way to tell Filtering to Keep only certain fields instead of only removing them

    I have a Macro I'm using that Filters out data that I dont need, but the data changes several times a day

    I need it to Delete Everything I dont need and only leave behind the stuff I want

    so right now... they way I have to do it, is to tell it to filter by known items that I want to get rid of, then tell it to delete those items and then undo the filter, which leaves the items I do want still sitting there

    we keep adding new categories, which means I have to add that category to my list of thins to tell the macro to delete

    Is there a way that I can make the macro only keep the data I want and not have to tell it to delete the specific data I dont want?

    the report I import the data from(manual copy and paste to the other sheet)
    and my sheet are attached...
    Macro Runs by pressing CTRL+SHIFT+D

    Right now the Macro process is
    Filter Data... keep "X" Categories"
    Delete all lines showing
    Undo Filter...(leaves all the rest of the items showing)
    sort by Date and Time
    populate Pivot table and barcode counts sheet


    this honestly works fine until they add more categories from new stuff... and then I have to go back in and edit that category list

    and because this is a shared sheet on a onedrive sharepoint server, I can only edit it when nobody is using it.. which basically only means late at night. which I'm trying to avoid having to deal with this late night at home away from work when I have better things to do.

  2. #2
    Registered User
    Join Date
    04-29-2017
    Location
    Midwest
    MS-Off Ver
    Office 365
    Posts
    32

    Re: is there a way to tell Filtering to Keep only certain fields instead of only removing

    Also....
    along the same lines as using Filters...
    Is there a way to tell it in a MAcro to Filter by one Letter.... so that all the numbers in a certain column that begin with the Letter T can be automatically removed??

    example being Column F.. some ate T1234567....
    I want to tell it to remove all the T's no matter what the other 7 numbers are...
    When I try to record a macro, it does individual order numbers and I just want to tell it generically T* and make them all go away

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: is there a way to tell Filtering to Keep only certain fields instead of only removing

    Try:

    Please Login or Register  to view this content.
    Edit: I never saw your post #2 - Nevermind!
    Last edited by xladept; 03-07-2018 at 02:17 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: is there a way to tell Filtering to Keep only certain fields instead of only removing

    This one filters Column F on numbers starting with T.

    Please Login or Register  to view this content.
    What do you want to do with result ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    04-29-2017
    Location
    Midwest
    MS-Off Ver
    Office 365
    Posts
    32

    Re: is there a way to tell Filtering to Keep only certain fields instead of only removing

    Quote Originally Posted by xladept View Post
    Try:

    Please Login or Register  to view this content.
    I dont quite understand what I should do with this.....
    can you give me an example??
    do I need to fill in something inbetween the <>? what does X mean??

    and I need something I can put several categories in...and then have it physically delete everything that doesnt match

    Right now I basically tell it multiple categories, then I delete all rows, then undo the filter so it leaves only the stuff I didnt delete
    the key is that I need to physically delete things I dont want in the pivot tables

    Please Login or Register  to view this content.

    Quote Originally Posted by bakerman2 View Post
    This one filters Column F on numbers starting with T.

    Please Login or Register  to view this content.
    What do you want to do with result ?

    I just want it to filter out my main data table in the macro
    so that it just delete's the things that begin with the letter "T" in column F in the QC outbound page when I run my macro that does all the other sorting for me as well
    so I just made it do this....

    Please Login or Register  to view this content.
    Last edited by s2h; 03-06-2018 at 06:20 PM.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: is there a way to tell Filtering to Keep only certain fields instead of only removing

    Please Login or Register  to view this content.
    Last edited by bakerman2; 03-07-2018 at 07:20 AM. Reason: Typo

+ 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. [SOLVED] VBA Pivot Fields Filtering
    By greggpetersen75 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-13-2013, 09:47 AM
  2. Removing All Pivot Fields from a Row Label except for one
    By akwishestofish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 11:39 AM
  3. [SOLVED] Removing Letters from the Fields in a Column
    By m.raby in forum Excel General
    Replies: 4
    Last Post: 06-28-2012, 08:58 AM
  4. Removing spaces throughout various fields
    By fretwizard in forum Excel General
    Replies: 8
    Last Post: 12-15-2008, 02:02 PM
  5. Filtering through successive fields
    By Arau in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2008, 07:03 AM
  6. removing hidden fields from equation?
    By djarcadian in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 07:10 PM
  7. Removing The N/A from showing in open fields
    By Killer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2006, 06:15 PM
  8. removing digit or calc LEN fields
    By tri_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2005, 01:05 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