+ Reply to Thread
Results 1 to 6 of 6

Color format a string

  1. #1
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Color format a string

    I adding a string to a cell like this.

    Please Login or Register  to view this content.
    How can I format the added string to be font.color = red

    I do not want the entire cell to be red.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Color format a string

    maybe
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Color format a string

    That would only look for the first Chr(10) and apply everything after correct.

    I would like to be able to have a different color for each line of characters added to the cell (delimited by Chr(10)).

    In retrospect, using individual cells for the information would have been easier for formating, but I need the row height to be dynamic.

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Color format a string

    or so
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Color format a string

    Thats a great bit of code Nilem. You are awesome.

    But unfortunately I didnt describe myself well enough.

    I use the code to insert a line of text into the cell that i want to also be able to colorcode. Not just arbitrarily alternate colors. So some lines will be red, some black etc.

    I could do an if statement and analyze each cell at the end, but why cant i just format the string when i insert it into the cell in the first place.

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Color format a string

    In any case, you have to decorate every part of the line again after inserting any substring.
    may be a small sample in a file?

+ 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. Format string color
    By tradinup2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2013, 08:26 AM
  2. Replies: 2
    Last Post: 02-25-2013, 03:36 AM
  3. [SOLVED] Remove numbers from alphanumeric string. No standard format to the string.
    By ricunger in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2012, 01:43 PM
  4. Replies: 0
    Last Post: 09-26-2012, 01:08 PM
  5. Color Codes: Localizing a number format string
    By stitchy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 02: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