Add Edit Range : User Access « Access « VBA / Excel / Access / Word






Add Edit Range

 
Sub AddEditRange()
    Dim ws As Worksheet, ual As UserAccessList, aer As AllowEditRange, usr As UserAccess
    Set ws = ThisWorkbook.Sheets("Protection")
    ws.Unprotect "Excel2003"
    Set aer = ws.Protection.AllowEditRanges.Add("Edit Range", ws.[a1:c4], "pass1")
    Set usr = aer.Users.Add("Power Users", True)
    ws.Protect "Excel2003"
End Sub

 








Related examples in the same category

1.Remove Edit Ranges
2.Show Edit Ranges
3.Unlock Edit Range
4.Build user list
5.Delete user list