Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Cell Protection
I have been using the below mentioned VBA code for cell protection,
It is protected only one Cell ("A2") We need to protect from A2 to A8, Pls help me. Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address < "$A$2" Then Exit Sub Application.EnableEvents = False MsgBox "Hey, leave me alone!" Application.Undo Application.EnableEvents = True End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cell Protection
Try...
Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Intersect(Target, Range("$A$2:$A$8")) Then With Application .EnableEvents = False: .Undo: .EnableEvents = True End With 'Application MsgBox "Hey, leave me alone!" End If End Sub -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Password Protection - paste to unprotected cell locks the cell | Excel Discussion (Misc queries) | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Need help with cell protection... | Excel Programming |