Syntax

expression.Users

expression A variable that represents an AllowEditRange object.

Example

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.

Visual Basic for Applications
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
users users property

See also: