Hello,
I'm trying to loop through a series of worksheet and delete any protection.AllowEditRanges the worksheet may have. The problem is that the edit ranges are deleted on the 1st workbook, but not the subsequent workbooks. Any help would be greatly appreciated. Thanks, Johnell
Sub DeleteCreateEditRanges()
Dim numWkStCount As Integer 'worksheet count
Dim numFGWrkShtCount As Integer 'functional group worksheet count
Dim numStartWrkSht As Integer
Dim intW As Integer
Dim intN As Integer
Dim string1 As String
Dim rng As AllowEditRange
'Get Number of worksheets
numWkSCount = Worksheets.Count
'Set last workhsheet to modify as last functional group sheet
numFGWrkShtCount = numWkSCount - 2
'Set first worksheet to add allow edit ranges as first functional group worksheet
numStartWrkSht = 4
For intW = numStartWrkSht To numFGWrkShtCount
intN = Worksheets(intW).Protection.AllowEditRanges.Count
string1 = Worksheets(intW).Name
If Worksheets(intW).Protection.AllowEditRanges.Count > 0 Then
MsgBox "Allow Edit Ranges = " & intC, vbInformation, "Worksheet " & Worksheets(intW).Name
For Each rng In Worksheets(intW).Protection.AllowEditRanges
rng.Delete
Next rng
End If
Next intW
End Sub
Bookmarks