Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Changing colour of text when text reaches certain length

  1. #1
    New Member
    Join Date
    May 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Can anyone tell me how I can change the colour of the text in a cell once the text in that cell reaches a certain length, say 80 characters long

  2. #2
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-09 18:38, hammo wrote:
    Can anyone tell me how I can change the colour of the text in a cell once the text in that cell reaches a certain length, say 80 characters long
    How about going with Conditional Formatting with Formula is
    =len(a1)>=80 ... FONT Color --> 'red'

    This will format the color of the text red if the text you have entered is more than 80 characters. It is not going to capture the length of the string as the text is being typed -- for that you may have to adopt DATA|VALIDATION.

    Hope This Helps!
    Regards!

    Yogi Anand, D.Eng, P.E.
    Energy Efficient Building Network LLC
    www.energyefficientbuild.com

  3. #3
    MrExcel MVP
    Join Date
    May 2002
    Posts
    14,211
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)

    Default

    Use conditional formatting & the LEN function:

    select the cell(s) you want to format. Go to format - conditional formatting. Change 'cell value is' to 'formula is'. Enter the appropriate formula, for example:
    =len(A1) > 80
    Click the format button & select the format you want to apply....

    Paddy

  4. #4
    New Member
    Join Date
    May 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Yogi & Paddy,

    Is it possible to do this real time (ie the moment the string they are typeing exceeds 80 chars rather than when they exit the cell?

  5. #5
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-09 20:24, hammo wrote:
    Thanks Yogi & Paddy,

    Is it possible to do this real time (ie the moment the string they are typeing exceeds 80 chars rather than when they exit the cell?
    In my opinion, practically speaking you can combine it with DATA|VALIDATION to permit a string of maximum number of characters -- and after the dtring has been entered, you would know whther it is more than 80 characters.

    For real time capture of the length of the string, you will have to use VBA.

    Regards!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •