ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Showing which cells are locked (https://www.excelbanter.com/excel-discussion-misc-queries/195121-showing-cells-locked.html)

smithista

Showing which cells are locked
 
Is there a way to show which cells in a worksheet are locked?

Thanks
Stephen

Jim Thomlinson

Showing which cells are locked
 
There is no facility to select all of the unlocked cells or such. What you
can do is to put the lock icon onto one of your toolbars...

Tools - Customize - Commands (tab) - Format - Lock Cell (icon about 3/4
the way down the list) - drag it to your toolbar...
--
HTH...

Jim Thomlinson


"smithista" wrote:

Is there a way to show which cells in a worksheet are locked?

Thanks
Stephen


Gary''s Student

Showing which cells are locked
 
First unprotect the worksheet and then run this macro:

Sub islocked()
Set rLocked = Nothing
For Each r In ActiveSheet.UsedRange
If r.Locked Then
If rLocked Is Nothing Then
Set rLocked = r
Else
Set rLocked = Union(r, rLocked)
End If
End If
Next
If rLocked Is Nothing Then
Else
rLocked.Select
End If
End Sub
--
Gary''s Student - gsnu200795


"smithista" wrote:

Is there a way to show which cells in a worksheet are locked?

Thanks
Stephen


Dave Peterson

Showing which cells are locked
 
Are you using Format|Conditional Formatting for anything?

If no, then how about using it to show the locked/unlocked cells?

Select your range (ctrl-A for all the cells).
Format|Conditional formatting
formula is: =CELL("protect",A1)

(Use the activecell's address instead of A1.)

smithista wrote:

Is there a way to show which cells in a worksheet are locked?

Thanks
Stephen


--

Dave Peterson

Gord Dibben

Showing which cells are locked
 
Sub Locked_Cells()
'Bob Flanagan source of code
Dim Cell As Range, tempR As Range, rangeToCheck As Range
'check each cell in the selection
For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
If Cell.Locked Then
If tempR Is Nothing Then
'initialize tempR with the first qualifying cell
Set tempR = Cell
Else
'add additional cells to tempR
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
'display message and stop if no cells found
If tempR Is Nothing Then
MsgBox "There are no Locked cells " & _
"in the selected range."
End
End If
'select qualifying cells
tempR.Interior.ColorIndex = 3
End Sub


Gord Dibben MS Excel MVP

On Wed, 16 Jul 2008 10:56:13 -0700, smithista
wrote:

Is there a way to show which cells in a worksheet are locked?

Thanks
Stephen




All times are GMT +1. The time now is 03:31 PM.

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