UserAccessList 集合的功能(VBA)
更新時間:2009年07月15日 20:18:13 作者:
可用 ProtectedRange 對象的 Users 屬性返回一個 UserAccessList 集合。
返回一個 UserAccessList 集合后,便可用 Count 屬性來確定訪問受保護區(qū)域的用戶數(shù)量。在下例中,Microsoft Excel 將訪問第一個受保護區(qū)域的用戶的數(shù)量通知給用戶。本示例假定受保護的區(qū)域位于活動工作表上。
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
復制代碼 代碼如下:
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
相關文章
當編輯框內(nèi)容改變 對應的單元格也隨著改變vba代碼
當編輯框內(nèi)容改變 對應的單元格也隨著改變vba代碼2009-07-07