Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Protecting an Excel List

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Protecting an Excel List

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Protecting an Excel List


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List with total row and protecting Mel Excel Worksheet Functions 0 July 17th 07 05:12 PM
Protecting a sheet with a list on it aneasiertomorrow Excel Discussion (Misc queries) 3 May 11th 07 12:22 AM
Protecting a worksheet containing XML List John Allison Excel Discussion (Misc queries) 0 November 10th 05 10:07 AM
Leave list box unprotected while protecting worksheet acukid Excel Discussion (Misc queries) 1 September 13th 05 06:48 PM
Protecting and Locking a Mail Merge List Trish[_3_] Excel Programming 0 April 29th 04 03:48 AM


All times are GMT +1. The time now is 06:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"