ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Seeing Protected Cells (https://www.excelbanter.com/excel-discussion-misc-queries/31095-seeing-protected-cells.html)

Dave

Seeing Protected Cells
 
Is there a way to see which cells are protected without having to open
"Format/Cells.../Protect"?
--
Thanks
Dave

dominicb


Good evening Dave

This routine will work, but only on a range, so select the range you
want to check and run the macro. All cells are protected in a new
spreadsheet by default, so this routine will select all the UNPROTECTED
cells.

Sub UnlockCell()
Count = 0
On Error Resume Next
For Each Rng In Selection
If Rng.Locked = False Then
Count = Count + 1
If Count = 1 Then Set Unlocked = Rng
If Count < 1 Then Set Unlocked = Union(Unlocked, Rng)
End If
Next Rng
Unlocked.Select
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=379837



All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com