9Apr/1035

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.

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.

excel view locked unlocked cells

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.

 

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

excel view locked unlocked cells

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

excel view locked unlocked cells

 

 

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

excel view locked unlocked cells

Paste this formula:

=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.

excel view locked unlocked cells

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.

The cells are locked by default, so the list may be really long.

Did you find this post useful? Support the the author ($10)
My Google Profile+
Comments (35) Trackbacks (0)
  1. excellent trick. shame excel does not have a button that shows them like this. makes you wonder what they do all day in redmond.

  2. Thanks – this is really helpful. It also works in Excel 2003 but you must choose “Formula Is” from the dropdown, then paste the formula given above into the option box to the right.

  3. Awesome – Great work!!

  4. awesome

  5. Excellent Stuff !!!!

  6. what a boon! Thank you so much; extremely helpful

  7. This also works with the formula =CELL(“Protect”, A1)=1 (much easier to type!). You can choose the whole sheet or just a block of cells. Must ‘Unprotect Sheet’ for the formatting to work.

  8. This is sooooo helpful!!! THank you!!

  9. thanks for that! very helpful!

  10. Great tip! Huge time saver!

  11. Excellent!! saved me lots of trouble, here is the Excel Spanish translation of the formula, just in case someone else need it.

    =CELDA(“proteger”; INDIRECTO(DIRECCION(FILA();COLUMNA())))=1

  12. you’re a legend

  13. Great work… Thanks for the trick

  14. 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.

  15. Awesome! Thanks

  16. 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”.

  17. 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!)…

  18. Worked perfectly! Just what I needed!

  19. 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.

    How can I get windows Unhide back?

  20. Great formula, thanks!!!

    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:

    =CELL(“protect”; INDIRECT(ADDRESS(ROW();COLUMN())))=1

  21. Thanks for a comment.
    Actually it depends on your windows regional settings. I added a note!

  22. Excellent trick, thanks a million

  23. excellent – thank you

  24. Just what I needed. Thank you so much.

  25. Thanks – saved me ages!

  26. That is excellent and works perfectly. Thank you for taking the time to share this, it is much appreciated.

  27. 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.

  28. Thank you! Thank you! Thank you!

  29. Brilliant !!. One question: Why is a space needed before the INDIRECT function? (without this space it just doesn’t work)

  30. Thank you! This really helped me!

  31. You saved me hours of work. Thanks.

  32. Great trick! Thank you very much…. You saved me lots of hours!

  33. Just what I was looking for – thank you!

  34. Thank you, we needed it.

  35. Way cool! Some very valid points! I appreciate you penning this post plus the rest of the site is really good.


Leave a comment

No trackbacks yet.