+ Reply to Thread
Results 1 to 6 of 6

Delete rows in pairs if columns value match and cells have opposite numbers.

  1. #1
    Registered User
    Join Date
    12-29-2016
    Location
    United State
    MS-Off Ver
    O365
    Posts
    36

    Post Delete rows in pairs if columns value match and cells have opposite numbers.

    Hello,

    Looking for a code that active workbook "Data 1" out of various opened workbooks, then delete
    rows by pairs if values match on columns A, D, F, K and the rows have opposite numbers in column J.

    The code would be saved in a personal workbook, not in the workbook named "Data 1".
    Attached is a sample of the workbook "Data 1" (the original can have over 30k rows).

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,367

    Re: Delete rows in pairs if columns value match and cells have opposite numbers.

    This should do, you could check first with a copy of your file.

    Please Login or Register  to view this content.
    Last edited by JEC.; 01-15-2022 at 04:28 PM.

  3. #3
    Registered User
    Join Date
    12-29-2016
    Location
    United State
    MS-Off Ver
    O365
    Posts
    36

    Re: Delete rows in pairs if columns value match and cells have opposite numbers.

    Hi Jec,

    The code almost accomplished the desired result, but is deleting rows with with no opposite (+, -) numbers in column J.

    The rows with the following amounts should remain after the code is applied because these are not opposite numbers.

    9,000.00
    9,000.00
    13,500.00
    13,500.00
    19,125.00
    19,125.00

    Is there a tweak to the code so those rows are not deleted ? In the attached I marked those rows in green.

    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,367

    Re: Delete rows in pairs if columns value match and cells have opposite numbers.

    Ok how about this?

    Please Login or Register  to view this content.
    Last edited by JEC.; 01-17-2022 at 04:57 AM.

  5. #5
    Registered User
    Join Date
    12-29-2016
    Location
    United State
    MS-Off Ver
    O365
    Posts
    36

    Re: Delete rows in pairs if columns value match and cells have opposite numbers.

    Jec,

    The code works perfect. It delete rows with matching values on columns A, D, F, K and opposite numbers in column J.

    Thank you so much!

  6. #6
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,367

    Re: Delete rows in pairs if columns value match and cells have opposite numbers.

    You’re welcome!👍

+ 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. Replies: 4
    Last Post: 08-17-2020, 03:21 PM
  2. Need to Delete Multiple rows if numbers dont match on another sheet
    By STU22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2014, 11:22 PM
  3. Need to Delete Multiple rows if numbers dont match on another sheet
    By STU22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-05-2014, 11:22 PM
  4. [SOLVED] Random pairs of numbers for team match-ups
    By dubcap01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2014, 06:39 AM
  5. delete rows where the numbers dont match
    By steve111 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2014, 03:17 PM
  6. Sum and delete rows if columns A match
    By sg9207 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2010, 08:05 PM
  7. Counting Match Pairs In Rows
    By bmb2200 in forum Excel Formulas & Functions
    Replies: 67
    Last Post: 09-06-2005, 09:05 PM

Tags for this Thread

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