+ Reply to Thread
Results 1 to 2 of 2

Delete Row Macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Delete Row Macro

    I need help creating a Macro that will Delete the bottom Row it doesn't match in Columns J and P. I have over 15k files that I will need to narrow down and delete duplicates. I need the macro to start in row 1 and Check Columns J and P and see if the match Columns J and P from row 2. If they do it Deletes row 2 and then tries Row 3. If row 3 does not match then row 3 become the new row to be checked it it continues all the way down the sheet until there are no more values found in Column J. Any Ideas?

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Delete Row Macro

    You cant go down the row because when you delete a row, your count is off, (Row 3 gets deleted, moves row 4 to 3, then the counter moves to 4, skiping old 4.)
    You must go from the bottom up.

    for r = activecell.row to 2 step -1

    next

+ 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. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  2. Replies: 2
    Last Post: 09-13-2005, 12:05 AM
  3. Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  4. Replies: 0
    Last Post: 06-21-2005, 01:05 PM
  5. Re: Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 01:05 PM

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