+ Reply to Thread
Results 1 to 10 of 10

Conditional Formatting only top line of cell

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Conditional Formatting only top line of cell

    I have a worksheet with conditional formatting applied. My formula works to change the cell color, font color, and strike-through the font if a "yes" answer is indicated. It all works well EXCEPT that the font color and strike-through ONLY apply to the top line on my cell.

    Each cell has a title line, and a few paragraphs in it, with separations between the title line and the paragraphs. I kind of like having the title line a different font, but when it's time to strikethrough I want ALL of the text struck through.

    Any ideas on how to do this? Here's an example of my conditional formatting,
    Please Login or Register  to view this content.
    and a sample of the text in a cell:
    Please Login or Register  to view this content.
    Last edited by jomili; 02-01-2010 at 02:52 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formating only top line of cell

    You can't partially conditionally format a cell....


    Maybe with some VBA... but not with native Excel.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Conditional Formating only top line of cell

    Please re-read my post. Perhaps I phrased it awkwardly, but the problem is that Excel IS partially applying conditional formatting, and I want it to apply the conditional formatting FULLY. Excel now is applying the font attributes of the conditional formatting ONLY to the top line; I want it applied to all of the text in the cell.

    Also, one thing I think may be the culprit, is that the Title in the cell (top line) I manually format as italic, whereas the rest of the font is non-italic. If I make the italics-setting consistent in the cell, the conditional formatting works properly. But I'd like to keep the top line italicized to make it stand out. Any good ideas?
    Last edited by jomili; 02-01-2010 at 12:06 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formatting only top line of cell

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Conditional Formatting only top line of cell

    I've attached my samples. There are two tabs. In the first, the conditional formatting is working correctly, because all font is non-italicised. In the second, the top line in each cell is italicized, and so only that line is conditionally formatted correctly. I'd like to have the italicized first line in the cell, but apply the conditional formatting to the entire cell.
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formatting only top line of cell

    Hmmm.. interesting.. the fact that you manually partly formatted the cell to italics... "confuses" the conditional formatting.. I guess because it looks at maybe the first character of the cell to check the format and to see whether it needs to change it or not... and not the entire cell content.... I tested it by just changing the first character back to normal font, then the strike-through only applies to that first character...

    Not sure how to make it ignore the already applied format...

  7. #7
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Conditional Formatting only top line of cell

    "Interesting" is a nice, non-emotional way to look at it.

    To make the conditional formatting behave I have to change the formatting of the entire cell, and make it consistent, so the conditional formatting kicks in. I can live with not having the top line italicized, but it's certainly not what I want. If you can find me a workaround I'd sure appreciate it. I haven't looked into any VBA code for this one yet, as I was hoping there was a native way with Excel to do this.

    Thanks for all your involvement so far.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Conditional Formatting only top line of cell

    Maybe like this. Code goes in the Sheet module.
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formatting only top line of cell

    Sorry about downplaying it .. I know it is frustrating... but I also discovered that in XL2007, it formats as you desire (i.e. the whole thing strikes through and leaves first line italicized)... so probably a 2003 bug or something that got noticed and fixed later....

  10. #10
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Conditional Formatting only top line of cell

    SHG,
    Your solution worked beautifully! Thank you so much!

    NBVC,
    Nice to know I won't have to worry about if/when we ever upgrade our Office version.

+ 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