UserAccessList.DeleteAll Method (Excel)

Removes all users who have access to a protected range on a worksheet.

Syntax

expression .DeleteAll

expression A variable that represents a UserAccessList object.

Example

In this example, Microsoft Excel removes all users that have access to the first protected range on the active worksheet. This example assumes the worksheet is not protected.

Sub UseDeleteAll() 
 
 Dim wksSheet As Worksheet 
 
 Set wksSheet = Application.ActiveSheet 
 
 ' Remove all users with access to the first protected range. 
 wksSheet.Protection.AllowEditRanges(1).Users.DeleteAll 
 
End Sub 

See Also

Concepts

UserAccessList Object Members

UserAccessList Object