+ Reply to Thread
Results 1 to 2 of 2

How to build a filter that defines what to remove, not what to retain:

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    How to build a filter that defines what to remove, not what to retain:

    I think the title of this post is confusing, but I couldn't figure out a better way to word it.

    Here's what I'm trying to do:
    1. I'm building a macro that will always filter out certain pieces of data (always in Column B), and put the remaining data into a new tab on the spreadsheet. Once that's done, it will move back to the first Tab and un-filter the data. The problem I'm running into is that while I know which column fields will always need to be REMOVED, I DON'T necessarily know what fields will always need to be RETAINED (as new types of entries might be created or discovered).

    I'm finding that the Macro I've built consistently removes what I want it to, but if there's anything that's never been entered into the spreadsheet before, it will filter out as that as well (which I don't want it to).

    I guess what I'm trying to say is that the Macro I've built seems to know exactly what items to KEEP, when I need it to know exactly what items to REMOVE.

    Here's what I'm using:

    ' MacroTest Macro
    '

    '
    Columns("A:C").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$C$7").AutoFilter Field:=2, Criteria1:=Array( _
    "Debit Card Purchase", "Pre-Auth Debit", "="), Operator:=xlFilterValues
    Rows("1:15").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Range("A1").Select
    ActiveSheet.Paste
    Range("C18").Select
    Sheets("Sheet1").Select
    ActiveSheet.Range("$A$1:$C$7").AutoFilter Field:=2
    Range("H20").Select

    Thanks in advance for everyone's help:
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: How to build a filter that defines what to remove, not what to retain:

    Another, even better way to accomplish the same thing would be to build something that did the following: "If Column D AND Column E are BOTH blank, filter that column out." that would universally fix my problem.

    Thanks again,

    Also, looking at the threads, I think I should have put this in the Macros Forum. I'm going to see if there's a way to move it myself...

+ 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] Retain Order but Remove Duplicates
    By ssjagger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-05-2014, 08:02 AM
  2. Remove duplicate address rows but retain spouse name
    By dsrinssyb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2013, 03:57 PM
  3. Replies: 5
    Last Post: 02-21-2013, 11:37 AM
  4. Replies: 3
    Last Post: 11-11-2012, 01:27 AM
  5. inserting / remove rows and retain formatting
    By task in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2009, 02:24 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