UserAccessList 集合的功能(VBA)
更新時(shí)間:2009年07月15日 20:18:13 作者:
可用 ProtectedRange 對(duì)象的 Users 屬性返回一個(gè) UserAccessList 集合。
返回一個(gè) UserAccessList 集合后,便可用 Count 屬性來(lái)確定訪問(wèn)受保護(hù)區(qū)域的用戶數(shù)量。在下例中,Microsoft Excel 將訪問(wèn)第一個(gè)受保護(hù)區(qū)域的用戶的數(shù)量通知給用戶。本示例假定受保護(hù)的區(qū)域位于活動(dòng)工作表上。
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
復(fù)制代碼 代碼如下:
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
相關(guān)文章
用vba實(shí)現(xiàn)將記錄集輸出到Excel模板
用vba實(shí)現(xiàn)將記錄集輸出到Excel模板...2007-02-02當(dāng)編輯框內(nèi)容改變 對(duì)應(yīng)的單元格也隨著改變vba代碼
當(dāng)編輯框內(nèi)容改變 對(duì)應(yīng)的單元格也隨著改變vba代碼2009-07-07VBA 瀏覽文件夾對(duì)話框調(diào)用的幾種方法
VBA 瀏覽文件夾對(duì)話框調(diào)用實(shí)現(xiàn)代碼。大家可以根據(jù)需要選擇。2009-07-07