+ Reply to Thread
Results 1 to 7 of 7

Macro To Highlight Repeated Data On Worksheet

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Macro To Highlight Repeated Data On Worksheet

    Could someone please help me with this problem

    I have attached a sample sheet, what I need is a macro that will highlight all lines that appear on my worksheet 3 times or more.

    The data to look at will be in Column G, when the numbers in there appear 3 times or more I would like Columns A – L need to be highlighted

    Many Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Macro To Highlight Repeated Data On Worksheet

    How about just using conditional formatting.

    In column M beginning with M2 and copied down...

    =COUNTIF($G$2:$G$46,G2)

    Then...

    Conditional Formatting
    • Highlight applicable range >> A2:M46
    • Home Tab >> Styles >> Conditional Formatting
    • New Rule >> Use a formula to determine which cells to format
    • Edit the Rule Description: Format values where this formula is true: =$M2>2
    • Format… [Number, Font, Border, Fill]
    • OK >> OK
    HTH
    Regards, Jeff

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Macro To Highlight Repeated Data On Worksheet

    Instead of a Macro, why not just use conditional formatting?

    1. Select your range (in your example file the range is A2:L46)
    2. Click Conditional Formatting and use the following formula as criteria: =COUNTIF($G:$G,$G2)>=3
    3. Choose how you want the matching cells formatted and click OK.

    - Moo

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Macro To Highlight Repeated Data On Worksheet

    If you rather a macro...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro To Highlight Repeated Data On Worksheet

    wow Thanks for the quick response, i would prefer a macro if possible. Jeff i have tried your Macro but nothing seemed to highlight.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Macro To Highlight Repeated Data On Worksheet

    Try this...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro To Highlight Repeated Data On Worksheet

    Hi Jeff

    That works well, thanks for all your help. Problem Solved
    Last edited by SilverFox; 11-20-2012 at 05:40 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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