+ Reply to Thread
Results 1 to 5 of 5

determining if cell text string is multicoloured and change.

  1. #1
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    determining if cell text string is multicoloured and change.

    Hi There,

    I have a range of cells some of which may have their contents in two colors for example:

    123/456 the "/456" may be a different colour to "123" but it equally could be "456" being a different color to "123/" fortunately the color of the '2nd segment' will always be a light blue (defined as: font.colorindex = 23)

    any idea's how I can check the font colour of a specific part of a text string?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: determining if cell text string is multicoloured and change.

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: determining if cell text string is multicoloured and change.

    Not sure if this helps, because your post title and post text seem to be asking two different things. But to address your post title:

    If there is more than one Font color in a cell's text, then .ColorIndex will be null.

    So if all you care about is: "Is there more than one font color in this cell (regardless of what colors they are)?" Then you can try:

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  4. #4
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: determining if cell text string is multicoloured and change.

    Quote Originally Posted by TMS View Post
    Please Login or Register  to view this content.

    Regards, TMS
    This is perfect, in my first run I arbitrarily re-formatted every cell with a "/" which worked fine in a test range of 2000 cells worked fine but slowed down when I started on the real data of 200K cells (not by much but by enough) this has allowed me to skip cells that don't need any action and has provided a significant speed boost.

    thank you.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: determining if cell text string is multicoloured and change.

    You're welcome. Thanks for the rep.

+ 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. Change the colour of single word in text string based on another cell value
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-03-2014, 09:41 AM
  2. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  3. Change font color based on the ending text string (date) of a cell
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-31-2013, 04:04 PM
  4. [SOLVED] How to place a value in one cell after determining if a string of cells contain a number?
    By vnetmanager in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-25-2013, 02:35 PM
  5. Determining the month name base on text in a cell
    By PCLIVE in forum Excel General
    Replies: 3
    Last Post: 10-11-2005, 04:05 PM
  6. Determining A Cell If it contain A string value
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-26-2005, 11:05 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