+ Reply to Thread
Results 1 to 5 of 5

Deleting Rows from 3 sheets back on matching columns

  1. #1
    Registered User
    Join Date
    03-25-2008
    Posts
    71

    Deleting Rows from 3 sheets back on matching columns

    Hi Everyone,

    I’ve bee working through this Marco for a while and for the life of me I just can’t figure out a working way to get this to go. I tried using an example that worked with 2 tabs in the past, but no dice.

    What I am trying to do is delete lines that match on all 3 of the included tabs based on set criteria. All these reports will have 2000-10000 lines of reconciliation data to review in any given month, so I’m looking for a way to speed up the process.

    Each sheet contains and “Amount”, but that’s really it, so this is what I’m thinking:

    SHEET “MAS90” – Column A can be concatenated with Column C to make a string we can use to match with the other sheets
    SHEET “MT” – Column B, Column C, and Column G can be concatenated to make the same string
    SHEET “TEDD” – Column B, Column C, and Column E can be concatenated to make the same string.

    Now, for those lines that match on all three sheets, the lines can be deleted. My only problem is if we charge three $500 fees for one person and two of the sheets capture all 3, and 1 report only captures 2 of them, is there a way to leave these on and highlight them for manual review?

    Hope this makes sense and thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Deleting Rows from 3 sheets back on matching columns

    Quote Originally Posted by motown View Post
    ... My only problem is if we charge three $500 fees for one person and two of the sheets capture all 3, and 1 report only captures 2 of them, is there a way to leave these on and highlight them for manual review?

    Could you explain this part in better detail, I can't seem to wrap my mind around it.

    Thanks
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting Rows from 3 sheets back on matching columns

    In terms of a macro, duplicate charges on the same sheet shouldn't be a problem. Since we are only deleting rows that match on all 3 sheets, we use sheet1 only as a basis.

    1) Create your concatenated strings as you've already outlined above
    2) Check the first string against the other sheets. If it matches on all 3 sheets, immediately delete all 3 and proceed to the next.

    This way, if Sheets1 and 2 have 3 $500 charges but sheet3 only has two, the first two will be deleted on sheets 1 and 2 but the 3rd charge will remain.

    And so on.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    03-25-2008
    Posts
    71

    Re: Deleting Rows from 3 sheets back on matching columns

    Quote Originally Posted by davegugg View Post
    Could you explain this part in better detail, I can't seem to wrap my mind around it.

    Thanks

    Some of our charges can be monthly and if a contract tells us to bill in quarterly terms, we could have "Joe Expat with three $500 fees that should be on every sheet. If one of those sheets is missing one of those lines I'd like to have none of them be deleted so I can go behind the scenes in the corresponding reporting system to see why the missing $500 didn't pull for a third time.

    The reason for this is due to the software sometimes seeing it's own data as duplicated data and thus doesn't include it in the report. It's a glitch we current fix manually, so having this aspect would be a blessing.

    does that help?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting Rows from 3 sheets back on matching columns

    The the attached sheet with this macro. I used worksheet formulas and the AutoFilter to delete all the rows at once, should be peppy enough.
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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