How to identify and select all locked cells in Excel?
To protect important cells from modifying before distribution, normally we lock and protect them. However, we may get trouble in remembering the location of locked cells, and get popping up warning alert now and then, when we re-edit the worksheet later. Therefore, we introduce you three tricky ways to identify and select all locked cells in Excel quickly.
- Identify and select all locked cells with Find command
- Identify and select all locked cells with Kutools for Excel
- Identify all locked cells with Kutools for Excel's Highlight Unlocked utility (only 1 step)
Actually, we can find out all locked cells in active worksheet with Find command by following steps:
Step 1: Click Home > Find & Select > Find to open the Find and Replace dialog box. You can also open this Find and Replace dialog box with pressing the Ctrl + F keys.
Step 2: Click the Format button in the Find and Replace dialog box. If you can't view the Format button, please click the Options button firstly.
Step 3: Now you get into the Find Format dialog box, check the Locked option under Protection tab, and click OK.
Step 4: Then back to the Find and Replace dialog box, click the Find All button. Now all locked cells are found and listed at the bottom of this dialog box. You can select all searching results with holding the Ctrl key or Shift key, or pressing the Ctrl + A keys.
If you check the Select locked cells option when you Lock and protect selected cells, it will select all locked cells in active worksheet, and vice versa.
Kutools for Excel's Select Cells with Format utility can help you quickly select all locked cells in a certain range. You can do as follows:
1. Select the range in which you will select all locked cells, and click the Kutools > Select > Select Cells with Format.
2. In the opening Select cells with Format dialog box, you need to:
(1) Click the Choose Format From Cell button, and select a locked cell.
Note: If you can't remember which cell is locked, please select a cell in a blank sheet that you never used it before.
(2) Uncheck the Type option;
(3) Only check the Locked option;
3. Click the Ok button.
Then you will see all locked cells in the selected range are selected as below screen shot shown:
Actually, Kutools for Excel provide another Highlight Unlocked utility to highlight all unlocked cells in the whole workbook. By this utility, we can identify all locked cells at a glance.
Click the Kutools Plus > Worksheet Design to enable the Design tab, and then click the Highlight Unlocked button on the Design tab. See below screen shot:
Now you will see all unlocked cells are filled by color. All cells without this fill color are locked cells.
Note: Once you locked an unlocked cell in current workbook, the fill color will be removed automatically.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 3 years agothanks - worked a treat!
- To post as a guest, your comment is unpublished.· 6 years agoThis code works perfect for me. Do you have code to "unselect" the cells?
- To post as a guest, your comment is unpublished.· 7 years agoTried using this code. Get at compile syntax error
In code Sub Selectlockedcells() highlighted in yellow
Red highlighted -
For Each Rng In WorkRng
If Rng.Locked Then
If OutRng.Count = 0 Then
Set OutRng = Rng
Set OutRng = Union(OutRng, Rng)
I'm trying this on a sheet that is protected. Tried protected/unprotected - get same error message
- To post as a guest, your comment is unpublished.· 7 years agoI've tried to use the VBA code but I get a compile error at the "If Rng.Locked Then"
I'm trying to get this to work on a sheet that is protected. I've protected/unprotected but code stops at this point?
Am I missing something.
- To post as a guest, your comment is unpublished.· 7 years agoUnder certain conditions, this macro does NOT tell the truth. If you for example unlock the entire column B of a [u]new[/u] worksheet and then run the macro, it will wrongly assert that all cells are locked. The reason for such behavior is that format changes (like unlocking a range) applied to [u]entire[/u] columns or rows or sheets are mostly affecting cells [u]outside[/u] UsedRange as well.
- To post as a guest, your comment is unpublished.· 7 years agoThank you for your reply, we have re-write a new code for selecting locked cells directly, and the code is only applied for the used range. Please try it.