pulsarkuant
New Member
- Joined
- Jan 9, 2011
- Messages
- 20
I have the code below securing and preventing someone from deleting cell content in cell C9 only. How can I use the same code to protect Columns A2, B2, C2, D2, E2 and F2 and 2500 rows? I tried making A:F and a few other combinations, but it didn't work. Please note: I still want users to edit or enter new data.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$9" Then Exit Sub
If Len(Target.Value) = 0 Then
Application.EnableEvents = False
Application.Undo
MsgBox "You can't Delete,,,!"
Application.EnableEvents = True
End If
End Sub