+ Reply to Thread
Results 1 to 6 of 6

Highlight Alternate Duplicate Cells Based on Selection

  1. #1
    Registered User
    Join Date
    01-04-2018
    Location
    Bristol
    MS-Off Ver
    2016
    Posts
    5

    Highlight Alternate Duplicate Cells Based on Selection

    Hi All,

    Thanks for your help in advance.

    I have a piece of code which will highlight all duplicates in a row with alternate colours:

    Please Login or Register  to view this content.
    I was wondering if anyone knew a way I could set the macro to look within a selection, i.e. I select row A, or A2:A200 manually, and I can then run the code through selecting the module through the quick access toolbar. (Without having to set the range within the code each time.)

    The data will be in text form, i.e:

    Ben Smith
    Ben Smith
    John Doe
    John Doe
    Alice Evans
    Alice Evans
    Ana Smith
    Ana Smith
    James Smith
    James Smith
    James Smith
    Daria Burton
    Daria Burton

    Thanks again for your help,

    Alex
    Last edited by dxz; 04-10-2018 at 10:27 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Highlight Alternate Duplicate Cells Based on Selection

    Try this:-
    NB:- this is based on selecting data in one specific column.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    01-04-2018
    Location
    Bristol
    MS-Off Ver
    2016
    Posts
    5

    Re: Highlight Alternate Duplicate Cells Based on Selection

    Hi Mick,

    Thanks for your reply - sorry if my post was unclear.

    I am looking for a way to make the module work within a dragged selection range, rather than a specified row.

    I am looking to change this part of the code to something like:

    Set RngData = selection

    But cannot quite work out how do to this with the count.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Highlight Alternate Duplicate Cells Based on Selection

    I've modified the code accordingly (see code) and change the Line:-
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    This will enable you to select a range instead of it being pre selected.
    Regrds Mick

  5. #5
    Registered User
    Join Date
    01-04-2018
    Location
    Bristol
    MS-Off Ver
    2016
    Posts
    5

    Re: Highlight Alternate Duplicate Cells Based on Selection

    Perfect, Thank you!

    I was almost there..!

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Highlight Alternate Duplicate Cells Based on Selection

    You're welcome

+ 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] Highlight cells based on dropdown selection
    By fbhav in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 01-04-2021, 03:17 AM
  2. [SOLVED] Highlight cells based on drop down selection
    By cbetsinger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2017, 09:23 PM
  3. [SOLVED] Highlight particular rows based on cell selection
    By chickpeazy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-31-2017, 10:13 AM
  4. Highlight duplicate based on a different columns contents
    By spidervarient in forum Excel General
    Replies: 6
    Last Post: 05-08-2017, 03:49 PM
  5. Replies: 1
    Last Post: 07-03-2013, 10:50 AM
  6. Replies: 0
    Last Post: 07-22-2011, 12:11 PM
  7. VB - Highlight a selection of cells
    By adgjqetuo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2009, 04:33 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