+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting and Protected Locked Cells Not Working

  1. #1
    Registered User
    Join Date
    12-20-2023
    Location
    Idaho
    MS-Off Ver
    2016
    Posts
    3

    Conditional Formatting and Protected Locked Cells Not Working

    I have a spreadsheet that runs an automatic formula AND has conditional formatting. When I lock the cells/column, the calculations nor the conditional formatting run. Any help?

    Below is the detail of the spreadsheet:

    In cell D2, I enter in a data (e.g., 12/1/2023). In cell E2, the formula will calculate 75 days from the date in cell D2 (=D2-75). The answer is 9/17/2023. In cell F2, it will calculated 90 days from the date in cell D2 (=D2-90). Answer being 9/2/2023. I have conditional formatting in both column D and E to change to a color.

    Column D will highlight red if the date that is entered is 60 days or less from today's date (=AND(D1<>"",D1<=TODAY()+60,G1=""). Column E will highlight yellow if the date that is calculated is 75 days or less (=AND(E1<>"",D1<=TODAY()+75,G1=""). Both columns will loose their color if anything is put in the corresponding cell in column G. There is no conditional formatting in column F.

    I want to lock/protect columns E & F so the formulas and conditional formatting don't get changed. However, when I lock it, the conditional formatting and calculations do not happen.

    Any help with this problem?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting and Protected Locked Cells Not Working

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-20-2023
    Location
    Idaho
    MS-Off Ver
    2016
    Posts
    3

    Re: Conditional Formatting and Protected Locked Cells Not Working

    See the attached workbook as suggested.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Conditional Formatting and Protected Locked Cells Not Working

    The problem was in your formula:

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


    You should not point to the header of the table.

    In the file attached I also converted your table to Excel named table so your formulas will be automatically be filled, formatting also will follow.
    To add a new line you go to the last cell [Ctrl] + [End] buttons pressed together and then press [TAB], you will have the counter in your first column there for you, no need to type.

    Use of Excel named table is a good practice.

    Here is a quick video explaining the advantages of it.
    7 Reasons Why you Should use Excel Tables
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-20-2023
    Location
    Idaho
    MS-Off Ver
    2016
    Posts
    3

    Re: Conditional Formatting and Protected Locked Cells Not Working

    Thank you for improving my workbook!

    A few things that are not working in this version compared to my original.
    1. When I protect the columns E, F, K, L, I am unable to TAB and add an additional row
    2. When the workbook is unprotected and I add an additional row, the formulas in columns E & F autofill with #######. Columns K & L fill with R$ 0.00. In my original, the cells remain blank but the cell and formatting still run.

    The issue is after I protect columns E, F, K, L, the conditional formatting calculations don't happen. Any help with that?

    Thanks for letting me know about the named tables. I will use this more.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Conditional Formatting and Protected Locked Cells Not Working

    I love Excel Tables. The one issue I have with them is that they do not play well with locked cells unfortunately. You have to get really creative.

  7. #7
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Conditional Formatting and Protected Locked Cells Not Working

    TheNateDog, as Gregb11 said locked cells are a problem and this part of protect sheets I don't use much, so...

    But I'm glad that you enjoyed the discovery of Excel Tables and hope for you a happy Marry Christmas!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting and Protected Locked Cells Not Working

    I once had to develop a solution that worked with protected sheets and structured tables. Basically, a worksheet change event handler monitored the sheet and, if data was entered in the row immediately below the table, it unlocked the sheet, extended the table to include the new row, and protected the sheet. If there was a gap, it didn't attach the new data to the table. Essentially, it was trying to emulate what a structured table does naturally. I seem to remember it was a little more complicated than that.

    It's a major flaw in the design of structured tables.

  9. #9
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Conditional Formatting and Protected Locked Cells Not Working

    Some other things I've done in the past:

    Put conditional formatting on the column that if ISFORMULA, then fill with grey. That way if they typed over a formula, it would not be shaded and stand out. You could also put an error message some where that if the whole table column wasn't a formula, an error message would appear.

    Also, you could put Data Validation on those columns. Something like, "Text Length" must be equal to 200 and the error alert would be "Don't type in this cell". (I used 200 because I figured no one would ever enter text exactly as 200 - you could use whatever you want.) And as you expanded and changed the table info, you would not get an error in that cell.

+ 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] Copying Conditional Formatting when cells are/aren't protected
    By Murman01 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2023, 02:44 AM
  2. [SOLVED] How to allow VBA to run in locked cells while the sheet is protected
    By mmcap64 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2020, 11:36 AM
  3. Replies: 2
    Last Post: 01-07-2020, 02:33 AM
  4. Replies: 1
    Last Post: 05-08-2019, 10:55 AM
  5. Replies: 2
    Last Post: 05-14-2014, 09:14 AM
  6. Formatting cell within a Protected and Locked Sheet
    By drgogo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2009, 12:53 PM
  7. Conditional Formatting to highlight protected cells
    By lostinformulas in forum Excel General
    Replies: 1
    Last Post: 02-16-2009, 02:52 PM

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