AllowEditRange.Users Property (Excel)

Returns a UserAccessList object for the protected range on a worksheet.


expression. Users

expression A variable that represents an AllowEditRange object.


In this example, Microsoft Excel displays the name of the first user allowed access to the first protected range on the active worksheet. This example assumes that a range has been chosen to be protected and that a particular user has been given access to this range.

Sub DisplayUserName() 
 Dim wksSheet As Worksheet 
 Set wksSheet = Application.ActiveSheet 
 ' Display name of user with access to protected range. 
 MsgBox wksSheet.Protection.AllowEditRanges(1).Users(1).Name 
End Sub

See also

AllowEditRange Object