+ Reply to Thread
Results 1 to 5 of 5

macro to delete rows based on returned row reference

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Kitchener, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    39

    macro to delete rows based on returned row reference

    Hey all,

    I need help coding a macro.
    Please see the attached sample data.

    The formula in “K” references the number of the row from column “H” where SDAMT and SDCASH match.

    I need a macro to delete:

    • The row number that the formula in “K” is referencing
    • As well as the row that the value in “K” is in.

    Example, K3 says 2 because H2 and I3 match each other. Based on this I need row 2 and 3 deleted

    Can anyone help?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: macro to delete rows based on returned row reference

    In your real worksheet does column L have anything in it? The reason why I ask is because deleting row references in a loop will be problematic with the information you provided. There are many ways around this, ie using column L temporarily, but I would like a little bit more information that way I don't supply you with a code that could be flawed later on.

  3. #3
    Registered User
    Join Date
    12-13-2012
    Location
    Kitchener, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: macro to delete rows based on returned row reference

    column L would be temporary. I would likely have the macro generate the formulas in that column, delete all necessary rows based on the values, and then delete column L once finished

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: macro to delete rows based on returned row reference

    Not quite sure if you answered my question so here it goes:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-13-2012
    Location
    Kitchener, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: macro to delete rows based on returned row reference

    it worked great, thanks so much.
    and my apologies, no, there is nothing in column L in my real workbook.

+ 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