Excel VBA实现保护解锁所有的工作表

2015-09-16 0 722
Excel VBA实现保护解锁所有的工作表
Public Function ProtectAllSheets()
Dim sheet As Worksheet
For Each sheet In ActiveWorkbook.Worksheets
sheet.EnableSelection = xlUnlockedCells
sheet.Protect Password:="Password", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
Next sheet
End Function

Public Function UnprotectAllSheets()
Dim sheet As Worksheet
For Each sheet In ActiveWorkbook.Worksheets
sheet.Unprotect Password:="Password"
Next sheet
End Function

遇见资源网 ASP/Basic Excel VBA实现保护解锁所有的工作表 http://www.ox520.com/13510.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务