N
Neal Zimm
Hi All,
I use the procs below to protect and unprotect sheets.
At times, (and I can't find the 'pattern'), I lose the
cursor after protecting the sheet.
After 'manual' protection the cursor moves to a unlocked cell.
If I've changed a locked cell in a macro, do I have to select a
Not .Locked cell to make sure the cursor is there
after protection ?
Thanks.
Sub UNprotectStdId(Ws As Worksheet, Optional Id As String = "")
If Not Ws Is Nothing Then Ws.UNprotect Id
End Sub
' Code to change a range
Sub ProtectStdId(Ws As Worksheet, Optional Id As String = "", _
Optional SelectionType As Long = xlUnlockedCells)
If Not Ws Is Nothing Then
Ws.Protect Id, AllowFormattingCells:=True
Ws.EnableSelection = SelectionType
End If
End Sub
I use the procs below to protect and unprotect sheets.
At times, (and I can't find the 'pattern'), I lose the
cursor after protecting the sheet.
After 'manual' protection the cursor moves to a unlocked cell.
If I've changed a locked cell in a macro, do I have to select a
Not .Locked cell to make sure the cursor is there
after protection ?
Thanks.
Sub UNprotectStdId(Ws As Worksheet, Optional Id As String = "")
If Not Ws Is Nothing Then Ws.UNprotect Id
End Sub
' Code to change a range
Sub ProtectStdId(Ws As Worksheet, Optional Id As String = "", _
Optional SelectionType As Long = xlUnlockedCells)
If Not Ws Is Nothing Then
Ws.Protect Id, AllowFormattingCells:=True
Ws.EnableSelection = SelectionType
End If
End Sub