Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,423
    Thanks
    126
    Thanked 5 Times in 5 Posts

    Macro or Formula to delete rows where values and stock $# is the same

    I have debit values in Col F , credit values in Col G and stock numbers in Col H

    Where the values in Col F & G are the same and the stock value is also the same , the rows containing these values are to be deleted

    I have attached sample data. The rows data highlighted in Yellow must NOT be deleted

    It would be appreciated if you would provide me with code or a formula to delete the rows where col F & G have the same valu and the stock number is the same
    Attached Files Attached Files
    Last edited by HowardC; 2013-11-25 at 09:05.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    in I2 add the formula:
    =SUMIF(H:H,H2,F:F)=SUMIF(H:H,H2,G:G)

    Copy this down the column. You can filter for TRUE on this column and delete the rows. In your example in addition to rows 8,9.14.15 not being deleted, 22-24 would also not be deleted (or is there some reason you want to delete 22-24 that I don't understand based on the logic you listed...

    Steve

  3. #3
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,423
    Thanks
    126
    Thanked 5 Times in 5 Posts
    Hi Steve

    Thanks for the help. The items in rows 22-24 so not have been therre and can be ignored.

    I have tested your formulka on a large sample of data and it works perfectly

    Howard

Posting Permissions

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