Show Locked Cells

  • Thread starter Thread starter Evan Weiner
  • Start date Start date
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.
 
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
 
Back
Top