ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Show Locked Cells (https://www.excelbanter.com/excel-discussion-misc-queries/208375-show-locked-cells.html)

Evan Weiner

Show Locked Cells
 
How can I figure out which cells on a sheet are locked? I'm to check an
originator's locking before putting the workbook up.

Gary''s Student

Show Locked Cells
 
Try this small macro:

Sub findlocked()
Dim rr As Range
Set rr = Nothing
For Each r In ActiveSheet.UsedRange
If r.Locked = True Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If rr Is Nothing Then
Else
rr.Select
End If

End Sub

--
Gary''s Student - gsnu200810


"Evan Weiner" wrote:

How can I figure out which cells on a sheet are locked? I'm to check an
originator's locking before putting the workbook up.


Evan Weiner

Show Locked Cells
 
Instructive! I merely added a MsgBox for the sheet protection mode. ...
Thanks!

"Gary''s Student" wrote:

Try this small macro:

Sub findlocked()
Dim rr As Range
Set rr = Nothing
For Each r In ActiveSheet.UsedRange
If r.Locked = True Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If rr Is Nothing Then
Else
rr.Select
End If

End Sub

--
Gary''s Student - gsnu200810


"Evan Weiner" wrote:

How can I figure out which cells on a sheet are locked? I'm to check an
originator's locking before putting the workbook up.



All times are GMT +1. The time now is 12:46 AM.

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