+ Reply to Thread
Results 1 to 8 of 8

Highlight cell if duplicate text on another sheet in workbook.

  1. #1
    Registered User
    Join Date
    01-29-2014
    Location
    Dallas,Tx
    MS-Off Ver
    Excel 2013
    Posts
    9

    Highlight cell if duplicate text on another sheet in workbook.

    I have a project at work, that will involve many people updating the same workbook in excel.
    In Column A of every sheet, the cells are a text text field NNNXXXX. I want when I enter data in a cell in column A to highlight if that data is already entered in another sheet in workbook, in Column A.
    I see how to highlight if it's on the same sheet, under conditional formatting, but was looking for it to search all sheets in workbook and highlight cell if data entered is a duplicate.
    thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Are there a fixed number of sheets, or are more sheets added dynamically?

    There is no one expression you can use in a Conditional Formatting formula to check multiple sheets in one shot; a sheet array expression is invalid in CF. You could write a single long rule that checks every other sheet, but you would have to write an individual rule for each sheet where you want to apply the formatting. This is pretty easy unless you have a lot of sheets, or if you are dynamically adding new sheets.

    This could be done more easily with a macro. My approach would be to write a function that would be referenced in a CF rule, although it would be a Volatile function and so might slow things down. It could also be done with a macro that permanently (instead of conditionally) highlights the cells, which would run anytime there is a change to any cell in column A on any sheet. This could also slow things down, depending on how you are updating the data.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-29-2014
    Location
    Dallas,Tx
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Thanks for the reply.
    There will be many sheets to this workbook initially over 40, but will be whittled down to 8 once project is over.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Quote Originally Posted by jackm1249 View Post
    I want when I enter data in a cell in column A to highlight if that data is already entered in another sheet in workbook, in Column A.
    If someone enters a value in Sheet1 that is already entered in Sheet2, you want the new value in Sheet1 to be highlighted. Do you also want the original value in Sheet2 to be highlighted?

    If you attach a file I can install a macro that will do what you want. Otherwise I can provide code and you can do the installation.

  5. #5
    Registered User
    Join Date
    01-29-2014
    Location
    Dallas,Tx
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Quote Originally Posted by 6StringJazzer View Post
    If someone enters a value in Sheet1 that is already entered in Sheet2, you want the new value in Sheet1 to be highlighted. Do you also want the original value in Sheet2 to be highlighted?

    If you attach a file I can install a macro that will do what you want. Otherwise I can provide code and you can do the installation.


    I would be checking 2 columns column A and column H for duplicate values, (Text ) ( all dups, no matter what column it's in A or H)
    Highlighting both would be great.

    This workbook is on a shared folder and will be updated by many to include 40 or so locations, so I would need it to check infinite number of sheets.
    Hope that makes sense.

    Our inventory isn't what it should be, and we are getting multiple items at more than one branch.

    If workable that would be great sending me Macro.
    jackm1249
    Last edited by jackm1249; 09-24-2019 at 04:58 PM.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Sorry to take so long but I'm getting slammed at work. Will try to look first thing tomorrow. Sample file would be VERY helpful.

  7. #7
    Registered User
    Join Date
    01-29-2014
    Location
    Dallas,Tx
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Highlight cell if duplicate text on another sheet in workbook.

    Quote Originally Posted by 6StringJazzer View Post
    Sorry to take so long but I'm getting slammed at work. Will try to look first thing tomorrow. Sample file would be VERY helpful.
    Not a worry, thanks for taking time to look into this.
    Ok this is just an example sheet.
    I will be having ( in this case cables) listed on column A and H over about 14 sheets in a single workbook.
    I would like to have: If a cable name is same in either column A or H on any sheet to highlight, when that user tries to enter that cable name.

    right now on this sample sheet1 in A4 i have a lan4011 but it's also on sheet1 H5 and again on Sheet2 at H3.

    Right now we are trying to stop duplicate cables from being entered. Because each DC has a set of cables, and some are labeled the same

    hope that makes sence.
    Attached Files Attached Files

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlight cell if duplicate text on another sheet in workbook.

    OK, here is a solution that works for any number of sheets, although run time may be a while for large workbooks.

    Every time you change a value in column A or column H of any sheet, it checks for duplicates
    It checks for duplicates in column A and column H of every other sheet
    If a duplicate is found, it is highlighted as yellow on both sheets
    If you change a highlighted value so it is no longer a duplicate, the yellow fill will be removed where you change the value, but not on other sheets where it was duplicated.
    It does not look for duplicates within the same sheet.
    Attached Files Attached Files

+ 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] VBA to highlight row based on duplicate cell from another sheet
    By Axis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2016, 08:33 AM
  2. Macro to Highlight Duplicates and add Duplicate text at a column
    By sanjay1248 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2016, 08:48 PM
  3. Replies: 2
    Last Post: 06-01-2015, 05:25 AM
  4. Replies: 20
    Last Post: 01-11-2014, 05:39 AM
  5. Replies: 5
    Last Post: 08-19-2013, 03:50 PM
  6. highlight duplicate data in another sheet
    By cauciu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 08:36 PM
  7. HIghlight Duplicate text
    By centwistle in forum Excel General
    Replies: 1
    Last Post: 06-23-2010, 04:55 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