VBA代码:一次保护工作簿中的所有工作表: Sub protect_all_sheets() top: pass = InputBox("password?") repass = InputBox("Verify Password") If Not (pass = repass) Then MsgBox "you made a boo boo" Goto top End If For i = 1 To Worksheets.Count If Worksheets(i).ProtectContents = True ...
VBA代码:一次保护工作簿中的所有工作表: Sub protect_all_sheets() top: pass = InputBox("passWord?") repass = InputBox("Verify Password") If Not (pass = repass) Then MsgBox "you made a boo boo" Goto top End If For i = 1 To Worksheets.Count If Worksheets(i).ProtectContents = True ...
Public Sub E8_ProtectAllSheets(Optional flag As Boolean = True, Optional password = "") '**批量工作表保护或者解保护 'shtslist待操作工作表名列表 以逗号分隔 例如 Dim shts As Sheets, sht As Worksheet, wbk Set wbk = ThisWorkbook Set shts = wbk.Sheets For Each sht In shts Call E8_Prot...
("Lock") bLock = rLock.Value Application.EnableEvents = False Application.ScreenUpdating = False If Target.Address = rLock.Address Then For Each ws In ThisWorkbook.Worksheets If bLock = True Then ws.Protect Else ws.Unprotect End If Next ws End If Application.EnableEvents = True Application....
Using the ‘Protect Sheet’ option will protect only that sheet. If you want to protect all sheets of a workbook then select the ‘Protect Workbook’ option. You can set passwords of any length, characters, or number, but keep in mind passwords are case-sensitive. To unprotect the sheet,...
可以使用VBA批量保护。Sub Pro_All()Dim i As Single For i = 1 To ThisWorkbook.Worksheets.Count Worksheets(i).Protect "123456" '密码是123456,设定其他字符可以更改 Next End Sub如果是解除密码,将protect更换为unprotect即可。Sub Pro_All()Dim i As Single For i = 1 To ThisWorkbook....
Way 2: Protect All Excel Sheets Once with VBA Code Way 3: Protect All Sheets on Workbook with Excel Permissions Way 4: Protect Part of Sheets in Workbook Once with Kutools for Excel Way 1: Protect Multiple Sheets with Protect function ...
UnderProtect workbook for, select one of the two options, or both: Check theStructurebox to protect the structure of a workbook. This will prevent the following actions: Viewing hidden worksheets. Renaming, moving, hiding or deleting sheets. ...
点击Ctrl+F或者点击查找,搜索protect字符。将<sheetProtection password="CF7A" sheet="1" objects="1...
ASAP Utilities »Sheets › 15 Protect multiple sheets at once...: This utility allows you to protect the selected or all sheets in your workbook with the same password at once. The built in method of Excel allows you to only protect one sheet a