UserAccessList Object

Excel Developer Reference

A collection of UserAccess objects that represent the user access for protected ranges.

Example

Use the Users property of the protected Range object to return a UserAccessList collection.

Once a UserAccessList collection is returned you can use the Count property to determine the number of users that have access to a protected range. In the following example, Microsoft Excel notifies the user the numbers users that have access to the first protected range. This example assumes that a protected range exists on the active worksheet.

Visual Basic for Applications
  Sub UseDeleteAll()
Dim wksSheet As Worksheet

Set wksSheet = Application.ActiveSheet

' Notify the user the number of users that can access the protected range.
MsgBox wksSheet.Protection.AllowEditRanges(1).Users.Count

End Sub

See Also