+ Reply to Thread
Results 1 to 6 of 6

Change font colour for the words which are unique in the sheet

  1. #1
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    Change font colour for the words which are unique in the sheet

    Hello everyone,

    Thank you for your time. I am very new to VBA. Any possible help I could get will be extremely useful. In a worksheet, I have data from D11: E252. Each cell contains a string of text. I want a macro code that will change the font colour of first occurance.
    Attached Files Attached Files
    Last edited by Lona; 09-24-2021 at 04:08 AM.

  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: Change font colour for the words which are unique in the sheet

    Can you clarify your question?
    the words font colours that should be changed to red are apple (only once; however in the table it is mentioned 2 times)
    Why should "apple" be changed to red? If it is mentioned 2 times, it is not unique in the sheet. Same for almost everything else in your list. "Purple" is the only word that is unique in the sheet.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Change font colour for the words which are unique in the sheet

    This assumes that words are separated by a single space and that you're using Windows OS. If this is not the case then a more complex solution would be required:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    Re: Change font colour for the words which are unique in the sheet

    Hi 6StringJazzer,

    Thank you for your reply.
    May be "Unique" was not the right way to phrase it. There are repetitive words in the sheet, I want those words to be highlighted only once (i.e, font colour for the words in red) + the unique words. Please note each cell contains multiple words separated by spaces. I have attached the excel with a very little sample data with the expected outcome in first sheet & original data in second sheet, please let me know if you need a better sample sheet.

  5. #5
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    Re: Change font colour for the words which are unique in the sheet

    Thank you the code worked perfectly well.
    Last edited by Lona; 09-23-2021 at 09:56 AM.

  6. #6
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    Re: Change font colour for the words which are unique in the sheet

    HI,

    I have one follow-up question to the above code. I want the code to work only on the filtered data (visible cells at the time the macro is run). When I run this macro while there is some filtered data, it is highlighting for the entire sheet (non-visible cells as well). Is it possible show first occurrence only for the filtered data ?

+ 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] Change font colour of certain words on sheet
    By Tyrannis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2020, 10:11 AM
  2. Change font colour Entire sheet or workbook
    By mattydboom1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2019, 05:02 PM
  3. [SOLVED] change of font colour or background colour vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-22-2014, 08:20 PM
  4. Replies: 4
    Last Post: 09-16-2013, 04:23 PM
  5. Delete all words in a particular font colour
    By paulhg2 in forum Excel General
    Replies: 5
    Last Post: 11-29-2012, 10:34 AM
  6. Change Event to change Font to bold and colour Index
    By Wskip49 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-21-2008, 02:38 PM
  7. [SOLVED] Can't Change Font Colour
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2005, 12:06 PM

Tags for this Thread

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