+ Reply to Thread
Results 1 to 3 of 3

Macro for duplicate rows with conditional formatting (updated).

  1. #1
    Registered User
    Join Date
    01-25-2018
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Office 365 2017
    Posts
    5

    Macro for duplicate rows with conditional formatting (updated).

    Hello there!

    Running a science project and I've stumbled across some huge issues with duplicate rows.

    The issue as follows:
    I've got a dataset with around 3000 rows with different duplicate ID:s.
    The first row for every set of duplicates is the first event based on column O "Event_date".
    Based on the column H "Side" i'd like to delete forthcoming rows with the same ID
    that does not match the side of the first event row.

    I've attached an excel file with the issue and given some more examples of my problem.

    Sorry about my lack of skills in trying to explain my problem and also in excel...

    Thank you for the help!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by larssoderstrom; 03-21-2018 at 03:21 PM.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro for duplicate rows with conditional formatting.

    It would be more understandable if you only indicated what you want to delete. For instance, the first item in your example indicates that you want to keep the data. It leaves the question of the Primary entry's status of keep or delete.

    Edit this and add to it if more than three events. Only indicate what you want deleted.
    If 2 duplicates and the secondary event is on side 2 delete.
    If 2 duplicates and the secondary event is on the same side, do not delete either.
    If 3 duplicates then delete the earlier of the side with two events.
    Last edited by JLGWhiz; 03-19-2018 at 06:33 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    01-25-2018
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Office 365 2017
    Posts
    5

    Re: Macro for duplicate rows with conditional formatting.

    Hi, sorry for the bad explanation. I've uploaded a new excel file with examples, hopefully less confusing.
    Would be immensely grateful for all the help I can get.

+ 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. Replies: 2
    Last Post: 02-14-2017, 04:00 PM
  2. Conditional formatting macro - apply to all rows
    By iwalke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2015, 07:17 AM
  3. Inserting/Deleting Rows Causes Issues with Conditional Formatting Macro
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2014, 01:25 PM
  4. Duplicate Conditional Formatting
    By jbtenor1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2014, 11:14 AM
  5. [SOLVED] Conditional Formatting: Duplicate rows based on multiple columns.
    By Old4xford in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2014, 11:25 AM
  6. Replies: 56
    Last Post: 03-11-2014, 03:56 PM
  7. [SOLVED] Conditional formatting of duplicate rows (not duplicate cells)
    By ExcelStefan in forum Excel General
    Replies: 2
    Last Post: 06-19-2012, 06:09 AM

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