忘记Excel工作表保护密码,如何快速解除

一、保护工作表

步骤:点击【审阅】-【保护工作表】-勾选【选定锁定单元格】和【选定未锁定的单元格】-【确定】。随后设置单元格格式、插入行、删除行等都无法进行操作。

二、解除工作表密码保护

1、查看代码

步骤:右键【sheet1】-【查看代码】-打开代码窗口。

2、插入代码

Sub DeletePW()

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=True

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=True

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=True

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, AllowFiltering:=True

ActiveSheet.Unprotect

End Sub

步骤:粘贴代码,点击【运行】即可。

posted @ 2021-09-03 17:47  Ning-  阅读(11231)  评论(0编辑  收藏  举报