+ Reply to Thread
Results 1 to 14 of 14

Does Conditional Formatting apply to each Character in a Cell?

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Does Conditional Formatting apply to each Character in a Cell?

    Dear Forum,

    I am trying to do a very simple Task of employing conditional Formatting in a Cell $B$2 which contains the following letters i.e characters.. [ A B C D E ]

    They are coloured as follows :

    A B C D E and this cell is filled with BLACK Fill Colour

    Now If I enter 1 in the Cell $A$2, then the same colour scheme should remain in the Cell $B$2 but if I enter 2 then the formatting should change to BLUE FIll Colour and the Text to Yellow...

    But when I tried changing the value in the Cell A2 to 2 , then only the first letter i.e "A" changes to Yellow Colour while rest does not change its colour i.e. remain the same...

    Why is the entire cell B2 not getting formatted with all the contents?
    And what is the remedy for the same?

    Warm Regards
    e4excel
    Last edited by e4excel; 12-05-2009 at 02:58 PM. Reason: Spelling Mistakes

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Does Conditional Formatting apply to each Character in a Cell?

    I assume that A is formatted with the default cell's formatting, and the other letters are formatted individually in the formula editing box.

    Conditional formatting will only cange the default format of a cell, so the individual color formats you have set manually for the other letters will override CF.

    hth

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Quote Originally Posted by teylyn View Post
    I assume that A is formatted with the default cell's formatting, and the other letters are formatted individually in the formula editing box.
    I have formatted individually to "purple" colour so when there's 1 in F1 "A" remains the same i.e Purple however when I cahnge the value F1=2 then only "A" changes to Blue while rest of the Letters BCDE reamin unchanged..

    Conditional formatting will only cange the default format of a cell, so the individual color formats you have set manually for the other letters will override CF.
    Is there a way of overriding the same or an you suggest a workaround...

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Unless you want to involve VBA, there is probably no native Excel solution for this.

    My suggestion is to split the different colored elements out into separate columns, use the default formatting to format each cell and apply conditional formatting to change it.

    hth

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Ok thanks a lot Tevelyn got my answer that its not possible in Excel as I was unsure about that...!

    However if were to involve VBA , can you please add an attachment for the same..

    I had though of bifurcating the characters in Multiple cells but as per the existing design of the present workbook it won't be feasible..

    Would appreciate if you could come up with something via VBA which is not my CUp of Tea at all..

    Please provide explantions wherever neccessary as I do not get VBA very easily but off late have started using it more frequently with the Forum's help...

    Thanks a lot for the confirmation ANyways..

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Does Conditional Formatting apply to each Character in a Cell?

    can you please add an attachment for the same
    Sorry, my VBA is too basic to do stuff like that. Maybe start a new thread in the programming forum and explain that you want to programatically format parts of a text string based on conditions.

    hth

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Does Conditional Formatting apply to each Character in a Cell?

    You could put this in the sheet's code module.
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Dear Mick,

    I have tried using your code in my file but I am not sure whether am I using it correctly as Im no good in VBA.

    Nothings happening as in there's nothing new happening..
    I wil attach the file you can check and let me know...

    Thanks..
    Attached Files Attached Files

  9. #9
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Does Conditional Formatting apply to each Character in a Cell?

    mike is off line but
    place the code in the "VBAProject" "Microsoft Excel Objects" "sheet1"
    click on the work sheet1 and place the code
    (same as you have done in module1)
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Dear Pike,

    Thanks for the update, I knew that I was doing something wrong but am not good enough to even know that in VBA..
    However, though its working it turns completely blue after I enter 2 in A2 and does not show any text in B2..Please tell me what am i supposed to do about that?

    Just had a very quicjk question how many colours are there in Excel available to format..?

  11. #11
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Does Conditional Formatting apply to each Character in a Cell?

    how many colours are there in Excel available to format
    56 in Excel 2003, but you can change the default color palette. Gazillions in 2007.

  12. #12
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Quote Originally Posted by teylyn View Post
    56 in Excel 2003, but you can change the default color palette. Gazillions in 2007.
    Thanks Tevelyn,

    I was not sure about the range, anyways I use 2003 I would be limited to 56..

    Dear Forum,

    If someone can check the attachemnt and lemme know as to what changes I need to make then it would be great..!

    Regards

  13. #13
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Putting the code in the Sheet1 code module and removing the CF from B2 should fix things.
    Attached Files Attached Files
    Last edited by mikerickson; 12-08-2009 at 11:27 AM.

  14. #14
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Does Conditional Formatting apply to each Character in a Cell?

    Quote Originally Posted by teylyn View Post
    Gazillions in 2007.
    Technically, only 16,777,216. Each of the three main colors has 256 shades recognized, so it's 256^3. Don't really know why they have so many, though. I think it's one of those changes they made more because they could than because people demanded millions of colors.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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