Deleting a protected row
Better:
Activesheet.Unprotect Password:="myPassword"
Selection.EntireRow.Delete
WksProtect()
Sub WksProtect()
With ActiveSheet
If val(Application.Version) = 10 Then
.Protect " ", _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
Userinterfaceonly:=True, _
AllowFiltering:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True
Else
.Protect " ", DrawingObjects:=True, Contents:=True, Scenarios:=True,
Userinterfaceonly:=True
End If
' .EnableSelection = 'optional parameters (xlNoRestrictions, OR
xlNoSelection, OR xlUnlockedCells) -choose only 1
End With
End Sub
Regards,
GS
|