Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm getting an "Application or Object defined error" when I run the
following and it tries to delete an AllowEditRange Private Sub defineEditableRanges() ' defines the areas that can be edited on the protected worksheet. Const roomsTitle = "RoomNamesAndNumbers" Const deptTitle = "DeptAndPersonnel" Dim myRange As Range Dim wkSheet As Worksheet Set myRange = Columns("A:B") Set wkSheet = ActiveSheet ' first clear out any old ones ----------------------------- I need something like this or else I'll get an error when I try to add the same range again For Each er In wkSheet.Protection.AllowEditRanges If er.Title = roomsTitle Then er.Delete ------------------------------------------ Where I get the error ElseIf er.Title = deptTitle Then er.Delete End If Next wkSheet.Protection.AllowEditRanges.Add Title:=roomsTitle, Range:=myRange Set myRange = Rows("4:5") wkSheet.Protection.AllowEditRanges.Add Title:=deptTitle, Range:=myRange End Sub TIA for any insights |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting the text without deleting the formula | Excel Worksheet Functions | |||
Deleting cell data without deleting formula | Excel Discussion (Misc queries) | |||
deleting values in a worksheet without deleting the formulas | Excel Worksheet Functions | |||
how prevent formula in cell from deleting when deleting value???? | New Users to Excel | |||
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content | Excel Programming |