Detect and view locked and unlocked cells in Excel

While creating complex Excel based data input forms many cells needs to be protected from user input, like input labels, table titles, etc… When giving form to production I must be sure that all cells are properly locked. But, how to be sure if this having 1000+ cells ?

I discovered simple and visual technique to quickly detect and show locked and unlocked cells using Excel 2003 or 2007/2010.

[adsense_id=”1″]

Here is real life sheet scenario, 3 pages big Excel form used to capture data input and gather information. Everything must be standardized and locked to maintain data integrity, since form is used in automatic data extraction.

While developing such a form it is very easy to make a mistake and protect the wrong cell or leave cell unprotected. Usually this leads to complains from users or data in wrong cells.

[adsense_id=”1″]

I found the way to check all cells for Locked flag using “Conditional formatting”.

Recipe for excel 2007 how to view locked and unlocked cells visually

1. First select whole sheet by clicking on left upper corner

2. On the Home ribbon click “Conditional Formatting” button and click “New Rule”

3. In the window appeared choose “Use a formula to determine which cells to format”

Paste this formula:

1

=CELL("protect",INDIRECT(ADDRESS(ROW(),COLUMN())))=1

Depedning on your windows regional settings, you may require to change “,” to “;” in this formula.

Choose format for to identify locked cells, I chose red background.

Voila! Below is same form with protected cells highlighted with red background. It very easy to check now.

After all cells have been fixed, easy to remove this rule using same method.

If you put “=0” at the end of the formula it will show not locked cells, which is very useful to highlight “entry” fields for users, a common and recommended thing to do when protecting sheets.

Another method for detecting locked and unlocked cells using Find command

You can use the Find for that.

Go to menu Edit->Find, open the Options, open the Format selection and on the protection tab mark the option locked. With that, you can click on Find All and it will list all the locked cells on the worksheet.

If you equal 0 (=0 at the end) instead of 1, it’ll find the opposite; unlocked cells. This is very useful to highlight “entry” fields for users, a common and recommended thing to do when protecting sheets.

I keep MS Excel 2003 just for the its toolbar showing elegantly which cells are locked and which are not. When I get frustrated over the missing functionality in newer versions, I just go back to my old version. That is handy when working with large and complex spreadsheet. I do however appreciate this “workaround”.

Thank you so much; I have a complex spreadsheet with multiple users and despite repeated eductaion, people are still cut/paste into the sheet, bringing with their data the formats (including locked cells). this impacts other users as they can no longer sort/copy the columns and data they need.
this will “highlight” their entry error (and hopefully shame them into doing it correctly!)…

Our accounting software allows running reports to an 2007 Excel file.
When I do this the Windows Unhide, Ruler, Message Bar, Synch Scroll and several others are blocked. They prevented these features. I want to run macros but cannot, even after openning personal xlsb. They blocked this.

I’ve saved book1.xls as a Trans1.xlsm that didn’t work
I’ve openned Trans1 copied the cells containing data only, pasted this in a new Excel file as Paste Values. That didn’t work either.

One little tweek though: I kept getting errors when I pasted your formula and had to change the commas to semicolums. So if other people are also getting errors when trying this formula out, try to paste this one:

This truly is great. I am planning to add this to one of my addins so I will have it available all the time. Of course though, the macro will have to check if the sheet is already protected and prompt to unprotect it first.

Your formula works great, but i am trying to make it work with a checkbox. The formula i am using is: if($A$1=TRUE,(=CELL(“protect”, INDIRECT(ADDRESS(ROW(),COLUMN())))=1))
but the result only gets applied to A2. Is there any way to apply it to the whole sheet using the checkbox? Any help is much appreciated!