+ Reply to Thread
Results 1 to 7 of 7

Can I lock a conditional formatting range?

  1. #1
    Registered User
    Join Date
    09-15-2018
    Location
    Manchester, UK
    MS-Off Ver
    Professional 2016
    Posts
    8

    Can I lock a conditional formatting range?

    I frequently use conditional formatting for a whole column. For example, the range will be $A:$A so the conditional format rule will apply to everything in column A. However when I return to view it at a later date I find that it has become broken up into chunks. For example, it has become $A1:$A105; $A108:$A371; $A372:$A554; $A557:$A619 ... etc. I am always careful not to "cross contaminate" by copying column B cells into column A, etc. I can only conclude this comes about through sorting, or inserting or deleting rows. The conditional format formula is often such that I'm loathe to just clear the whole range and rewrite it, but there are frequently many broken up lines which have to be deleted manually which can be extremely time consuming. (As well as dull!). It gets even more complicated when there's more than one conditional format in a column and these different formats are interspersed.

    Is there a way to lock the format as $A:$A, so that insertion, deletion, sorting, etc. will not result in it breaking up?
    Kevin

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Can I lock a conditional formatting range?

    it is not wise to use the whole column
    i checked it up in excel table, no breaks
    Attached Files Attached Files

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Can I lock a conditional formatting range?

    I inserted/deleted rows in a CF with a whole column reference. No problems noted here...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    09-15-2018
    Location
    Manchester, UK
    MS-Off Ver
    Professional 2016
    Posts
    8

    Re: Can I lock a conditional formatting range?

    Thanks for the responses both. My suggestion that this outcome might be caused by inserting or deleting was merely that ... a suggestion. It might be caused by something entirely different. Obviously though something is causing it, as it's happening. I'm not re-examining the formatting after one or two, or a few, insertions / deletions / sorts. This is when I go back to view it quite a while later. In the meantime though I've done nothing I'm aware of to disrupt the continuity - i.e. copying pasting something which has a different conditional format from another column, or cutting from column A rather than copying. Thinking about it, the only explanation I come up with is that perhaps if I insert a row the formatting is broken there, stopping at the row before the one I insert, then starting again from the row after. However, as far as I'm aware if I use the column A cell in that new row it follows the conditional formatting rules so it is adding it ... just as a new rule for a fixed range rather than maintaining the $A:$A range. Specifying the whole column rather than, say, $A1:$A1048576 is the point. ... Which brings me back to the original question. $A:$A specifies all of the the cells in the column. It doesn't need to be changed to $A1:$A100;$A101:$A102:$A1:$A1048576, which gives the same result just in a more complicated manner. I'd like to lock the formula to $A:$A and not have Excel change it.

    Tim201110: I don't understand why I shouldn't use a whole column range ... that's kind of the point. I want every cell in column A to have that conditional format.

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

    Re: Can I lock a conditional formatting range?

    That's an annoyance of conditional formatting; inserting and deleting rows does exactly that, so you end up with dozens of redundant rules.

    It's enough of an annoyance that I wrote a simple macro with the shortcut Ctrl+Shift+A to copy the address of the selection. Then I go to CF, paste that into the first rule, and delete all below. With a little more work, a macro could apply the first CF rule to the selection and then delete all others.
    Last edited by shg; 09-15-2018 at 02:28 PM.
    Entia non sunt multiplicanda sine necessitate

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

    Re: Can I lock a conditional formatting range?

    To Tim's point, CF extends the used range of the worksheet, which makes for file bloat.

  7. #7
    Registered User
    Join Date
    09-15-2018
    Location
    Manchester, UK
    MS-Off Ver
    Professional 2016
    Posts
    8

    Re: Can I lock a conditional formatting range?

    Ah, OK, thanks shg. Sounds like I'll just have to carry on living with it. As for file bloat, I hadn't thought of that! Will try skinning the cat a different way to see what different it makes, size wise.

+ 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] Lock Down Conditional Formatting
    By ballard.ric in forum Excel General
    Replies: 1
    Last Post: 11-16-2017, 02:00 PM
  2. Using conditional formatting to lock cells
    By Virtualistix in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-06-2016, 07:28 AM
  3. Lock Worksheet to protect Conditional Formatting
    By meckenroth in forum Excel General
    Replies: 3
    Last Post: 04-03-2015, 10:31 AM
  4. 'Lock' conditional formatting
    By JoHansell in forum Excel General
    Replies: 3
    Last Post: 10-31-2013, 02:30 PM
  5. Conditional Formatting - Grey Out and Lock A range based on a cell value in that range
    By Excelgnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2012, 07:31 PM
  6. Conditional Formatting to Lock a Cell
    By Lizabeta in forum Excel General
    Replies: 6
    Last Post: 04-29-2009, 05:14 PM
  7. Replies: 6
    Last Post: 11-02-2007, 10:50 AM

Tags for this Thread

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