Show Locked Cells

E

Evan Weiner

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

Gary''s Student

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
 
E

Evan Weiner

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top