+ Reply to Thread
Results 1 to 9 of 9

How to control of repeating procedures? (delete duplicates rows)

  1. #1
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    How to control of repeating procedures? (delete duplicates rows)

    I would like to create a structure for repeated operations by using Do While Loop. The DElDuplicates, which searches for and deletes duplicates rows in a database is a good example to explain the situation. Having sorted the database on a specific 'code' field, the entries in the code column are processed row-by row. If the values of the currentCell and nextCell are the same, the currentCell row is deleted.

    I think my problem is caused by the reference objects. I don't know how to name it in my worksheet.

    Please Login or Register  to view this content.
    Capture.PNG
    Attached Files Attached Files
    Last edited by Luu4466; 07-19-2021 at 09:57 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to control of repeating procedures? (delete duplicates rows)

    Not sure if this helps

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,525

    Re: How to control of repeating procedures? (delete duplicates rows)

    Don't know if I understood your requirement right.
    When deleting I prefer to start at the bottom, even when it is not required at the odd instance.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    Re: How to control of repeating procedures? (delete duplicates rows)

    Thank you TMS for your answer. It doesn't work because I have an error signal.
    Capture.PNG

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to control of repeating procedures? (delete duplicates rows)

    You need to create Named Ranges as described at the beginning of the routine otherwise the code does not know what to sort, or on what basis.

  6. #6
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    Re: How to control of repeating procedures? (delete duplicates rows)

    I don't know how to name the range and where to name the range.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to control of repeating procedures? (delete duplicates rows)

    See the updated example.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    Re: How to control of repeating procedures? (delete duplicates rows)

    Thank you very much it's working, and screen capture were useful to understand.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to control of repeating procedures? (delete duplicates rows)

    You're welcome. Thanks for the rep.

+ 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] Delete Repeating Groups of Rows
    By jn83666 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2016, 03:07 PM
  2. [SOLVED] VBA Code to have a repeating form control /Active X control (List box) in every row
    By Ehezve in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2013, 08:55 PM
  3. How to Delete Repeating Values in Many Rows?
    By sadrap in forum Excel General
    Replies: 1
    Last Post: 01-06-2013, 12:49 PM
  4. Replies: 1
    Last Post: 11-12-2012, 03:03 PM
  5. Delete repeating heading rows
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-21-2008, 06:32 AM
  6. [SOLVED] delete repeating rows
    By aledger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-04-2005, 05:06 PM
  7. Closing form turns off commandbar control procedures??
    By Caro-Kann Defence in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2005, 06:06 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