+ Reply to Thread
Results 1 to 3 of 3

Macro to delete duplciate rows of data that have some unique components

  1. #1
    Registered User
    Join Date
    09-01-2018
    Location
    michigan, usa
    MS-Off Ver
    office 365
    Posts
    2

    Macro to delete duplciate rows of data that have some unique components

    Hello,

    I have a moderate understanding of excel functions but have zero experience with macros. I have a spreadsheet of data that has multiple entries for each unique subject and want to delete duplicate rows, saving only one row per subject that has the lowest number of "days". I have included a sample here. Any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Macro to delete duplciate rows of data that have some unique components

    This should work for you. To run this, go to the VBA window in excel (can be reached by pressing Alt + F11), create a new module by pressing insert > module, and paste the code in. Then, go to Tools > References and enable "Microsoft Scripting Runtime" by checking the box. After that, all you need to do is run the macro either by pressing the green arrow in the VBA window or by pressing F5. I'll attach a document with the code; sheet 2 shows the output, sheet 1 was your input. Hope this helps!
    Please Login or Register  to view this content.
    P.S. there is a forum specifically for VBA/macros found at https://www.excelforum.com/excel-pro...ng-vba-macros/
    If you have any more questions this would be the place.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-01-2018
    Location
    michigan, usa
    MS-Off Ver
    office 365
    Posts
    2

    Re: Macro to delete duplciate rows of data that have some unique components

    Worked perfectly, thank you so much!
    Last edited by alansidman; 09-03-2018 at 10:52 PM.

+ 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] [SOLVED] Macro to delete unique rows marked and remove 2nd duplicate row
    By SellMeTv2 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-29-2018, 09:03 PM
  2. [SOLVED] VBA macro delete non unique rows
    By bizzarofen in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-01-2017, 02:44 AM
  3. Macro taking rows of data and creating unique sheets
    By jharvey87 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-14-2016, 07:01 AM
  4. [SOLVED] Macro to delete rows for all unique cells in a row
    By capson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2014, 06:13 AM
  5. [SOLVED] Delete rows of data based on list of unique numbers with a macro
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2013, 07:40 AM
  6. Duplicate rows, delete columns w/same data, combine columns w/unique data, Mac Excel 2011
    By msmcoin in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 02-03-2013, 02:10 PM
  7. [SOLVED] Better way to delete macros & other components???
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2005, 05:45 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