Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a list using the Create List function. The users input
into the list using drop down lists. Other fields are completed using formulars. I want to protect the formulars however if I use Protect Sheet the list cannot be updated. I found this bit of code on this group that works fine however it will not allow the users to delete rows and I need that functionality. Can I add a few lines of code that will do the job? Private Sub Worksheet_Change(ByVal Target As Range) Dim myRng As Range Set myRng = Me.Range("AGRegionsProtected") On Error GoTo errHandler: If Intersect(Target, myRng) Is Nothing Then 'let 'em do it Else With Application .EnableEvents = False .Undo End With MsgBox "I've asked you not to change this range!" End If errHandler: Application.EnableEvents = True End Sub Thanks, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
If they are deleting the value, you could check if target.Value="" and allow it. If the entire row then, Target.Columns.Count = Columns.Count tells if the whole row is being deleted. NickHK "John" egroups.com... I have created a list using the Create List function. The users input into the list using drop down lists. Other fields are completed using formulars. I want to protect the formulars however if I use Protect Sheet the list cannot be updated. I found this bit of code on this group that works fine however it will not allow the users to delete rows and I need that functionality. Can I add a few lines of code that will do the job? Private Sub Worksheet_Change(ByVal Target As Range) Dim myRng As Range Set myRng = Me.Range("AGRegionsProtected") On Error GoTo errHandler: If Intersect(Target, myRng) Is Nothing Then 'let 'em do it Else With Application .EnableEvents = False .Undo End With MsgBox "I've asked you not to change this range!" End If errHandler: Application.EnableEvents = True End Sub Thanks, John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Nick, Sorry my VBA is very limited. If I want the users to be alowed to delete whole rows even if they contain my protected range where would I put the code? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List with total row and protecting | Excel Worksheet Functions | |||
Protecting a sheet with a list on it | Excel Discussion (Misc queries) | |||
Protecting a worksheet containing XML List | Excel Discussion (Misc queries) | |||
Leave list box unprotected while protecting worksheet | Excel Discussion (Misc queries) | |||
Protecting and Locking a Mail Merge List | Excel Programming |