+ Reply to Thread
Results 1 to 7 of 7

If contents match delete row

  1. #1
    Registered User
    Join Date
    10-07-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    3

    If contents match delete row

    If the contents in Column I is exactly the same as the contents in Column J then I want to delete the entire row; starting in Row 2 and repeating until every row with contents in Column I and J has been checked. Here’s what I have can you help?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: If contents match delete row

    Hi JBowie,

    I can see you know some vba so im not going to give you the solution
    its way more fun to find it yourself in my opinion

    keep in mind that you delete a row that means the cells move up but you didnt check that row
    the for loop keeps going
    try to do it without the for each but with a integer or long so when you delete a row, you go back 1 row because you didnt check that row yet it moved up

    i hope im clear enough
    Grtz
    Last edited by Joske920; 10-07-2018 at 02:03 PM.

  3. #3
    Registered User
    Join Date
    10-07-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    3

    Re: If contents match delete row

    I have not yet been able to figure this out on my own. Can someone help me?

  4. #4
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: If contents match delete row

    Hi JBowie,

    This should do it

    Please Login or Register  to view this content.
    Grtz

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: If contents match delete row

    When deleting rows you always start at the bottom and work your way up.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,481

    Re: If contents match delete row

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-07-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    3

    Re: If contents match delete row

    This works thank you

+ 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. [SOLVED] Macro to delete contents of cells if user delete contents of other cells
    By Stuartzz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-24-2018, 08:28 AM
  2. [SOLVED] VBA to MATCH cells and Delete contents!
    By Keibri in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-23-2016, 09:59 AM
  3. VBA macro to match information from one column with another and delete rows no match
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-17-2016, 04:07 PM
  4. [SOLVED] Delete contents of a cell in a given range if it matches contents of a specific cell
    By rcicconetti in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-13-2016, 06:46 AM
  5. Delete Rows that contain matching cell contents in column to the contents in cell B1
    By sspatriots in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2015, 05:39 PM
  6. How do I delete the contents in a cell, every other row?
    By ninj5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2013, 05:49 PM
  7. Replies: 6
    Last Post: 12-07-2012, 05:38 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