+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting with borders

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Conditional formatting with borders

    Hello,

    I have to do conditional formatting based on first two columns if cell contains "Total" then border for all cells. I have lots of sheets which are basically paste special from pivot tables. When I did paste special, then all formatting are gone from pivot tables.

    I just need to add borders where Totals are in either Column A or Column B. Can there be conditional formatting done, so that all sheets are selected at once and formatted together after paste special from pivot tables.

    For example in attached sheet, I need borders from Column A to P based on "Total" in column A & B.

    Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Conditional formatting with borders

    So you want border if a cell contains something in it?

    Highlight Columns A through P
    Click on Conditional Formatting
    New Rule
    Click on Format cells that only Contain
    In box underneath Format only cells with
    Click on drop-down box and select No Blanks
    Click on Format
    Click on Border - then Outline
    Click on OK and OK

  3. #3
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Conditional formatting with borders

    Select the cells you want conditionally formatted based on cells A12 and B12. With those cells selected, add the formatting condition with formula condition

    case-sensitive
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    case-INsensitive
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and set the format to display borders.

    See this example based on your sample workbook.

  4. #4
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Re: Conditional formatting with borders

    Hello,

    Thanks for replying. When I used the formula =OR(SUBSTITUTE($A$12,"Total","")<>$A$12,SUBSTITUTE($B$12,"Total","")<>$B$12, the borders are coming in all rows. See attached sample file. Can you please check what I am doing incorrectly as borders should be only with Totals.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Conditional formatting with borders

    FIRST you have to select the range to which you want to apply particular conditional formatting, THEN you enter the conditions and select the formatting.

    If conditional formatting is affecting ALL CELLS, you must have had only one cell selected when you specified the condition and format.

    If you want borders only applying to A12:P12, select A12:P12 first, then specify conditional formatting conditions and format.

    ADDED: You'll need to set different conditional formatting rules for each row. You can make this easier by applying conditional formatting to A12:P12 first, changing the formulas I gave previously to use $A12 and $B12 rather than $A$12 and $B$12. Then select A12:P12, copy, select the whole range, paste-special formatting.
    Last edited by hrlngrv; 05-05-2021 at 04:46 AM. Reason: addendum

+ 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. [SOLVED] Conditional formatting borders
    By mtcas in forum Excel General
    Replies: 4
    Last Post: 08-05-2020, 03:56 AM
  2. Conditional Formatting row borders, eliminate Inside Borders within row
    By lizziemac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2018, 11:06 PM
  3. Conditional Formatting using borders or colors-help!
    By NCHarpist in forum Excel General
    Replies: 2
    Last Post: 05-07-2013, 04:12 PM
  4. Locking Borders. Conditional Formatting
    By DandD in forum Excel General
    Replies: 20
    Last Post: 08-13-2010, 12:09 PM
  5. Conditional formatting - Borders
    By irons182 in forum Excel General
    Replies: 10
    Last Post: 07-09-2009, 11:13 AM
  6. [SOLVED] Conditional Formatting - Thick Borders?
    By fedude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2006, 05:35 PM
  7. [SOLVED] Conditional Formatting and Borders
    By Jrew23 in forum Excel General
    Replies: 4
    Last Post: 03-01-2005, 08:06 PM

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