Is there any way to completely lock out a cell from a user deleting the formula/information contained in it? Even with the cells being locked and hidden on a protected sheet, all a user has to do is click on an unlocked cell and drag their selection into the locked cells. If they hit delete, all your supposedly protected cells have their formulas deleted!!! And a nice consequence of this, is that since the cell is locked, you can't easily go back to re-enter the formula that was deleted, because it will kick you out of the cell since we don't want to change anything, right? Fun stuff. Good program.
I have not found any solution through vba (SelectionChange Events) or anything on the web that can prevent this from happening. So what is the point of locking cells and protecting the sheet when it's so easy get around it?
The code below works great in the worksheet code section for protecting a locked and hidden cell individually. If the user specifically clicks on a locked cell, it kicks them out to the next adjacent unlocked cell. But if they knowingly or accidentally click and drag a selection into the locked cell, all bets are off, they can change whatever they want.
------------------------------------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target1 As Range)
If Target1.Locked = True Then
Worksheets(1).Protect
ElseIf Target1.Locked = False Then
Worksheets(1).Unprotect
End If
End Sub
-------------------------------------------------------------------------------------------------------------
Is there some kind of "RangeChange" event that can be set in the worksheet code? If not, there certainly should be one, so that if any cell within a range selection is locked, even if the selection started on an unlocked cell, it prevents the user from issuing commands like "delete everything and break the worksheet please"....
Even in version 14, Excel still feels like a Beta program....
I have not found any solution through vba (SelectionChange Events) or anything on the web that can prevent this from happening. So what is the point of locking cells and protecting the sheet when it's so easy get around it?
The code below works great in the worksheet code section for protecting a locked and hidden cell individually. If the user specifically clicks on a locked cell, it kicks them out to the next adjacent unlocked cell. But if they knowingly or accidentally click and drag a selection into the locked cell, all bets are off, they can change whatever they want.
------------------------------------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target1 As Range)
If Target1.Locked = True Then
Worksheets(1).Protect
ElseIf Target1.Locked = False Then
Worksheets(1).Unprotect
End If
End Sub
-------------------------------------------------------------------------------------------------------------
Is there some kind of "RangeChange" event that can be set in the worksheet code? If not, there certainly should be one, so that if any cell within a range selection is locked, even if the selection started on an unlocked cell, it prevents the user from issuing commands like "delete everything and break the worksheet please"....
Even in version 14, Excel still feels like a Beta program....