remove user : Worksheet Protection « Excel « VBA / Excel / Access / Word






remove user

 

Sub RemoveUser()
    Dim ws As Worksheet, rng As Range, aer As AllowEditRange
    Set ws = ThisWorkbook.Sheets("Protection")
    ws.Unprotect
    Set aer = ws.Protection.AllowEditRanges("User Range")
    aer.Users("Power Users").Delete
End Sub

 








Related examples in the same category

1.Add protection to Worksheet
2.Protect Sheet
3.Unprotect worksheet
4.Show Protection Properties
5.Remove user edit range
6.Add user edit range
7.Formulas Protection
8.Protecting Worksheet Assets with the Protect Method