DonAndress
Active Member
- Joined
- Sep 25, 2011
- Messages
- 362
- Office Version
- 2019
- 2016
- Platform
- Windows
Hello.
I'd like to delete all editable ranges in the workbook, so I have this simple code:
But it's stuck on the aer.Delete part giving me "application or object defined error".
I have all sheets unprotected.
Can someone help me fix it?
I'd like to delete all editable ranges in the workbook, so I have this simple code:
Code:
Sub Macro4()
Dim wks As Worksheet
Dim aer As AllowEditRange
For Each wks In Worksheets
For Each aer In wks.Protection.AllowEditRanges
wks.Activate
aer.Delete
Next aer
Next wks
End Sub
I have all sheets unprotected.
Can someone help me fix it?