注: 僅用於自己忘記密碼用,不可以做其他用途呀
三步走
1. 在有工作表(sheet)保護右擊"查看密碼",如下圖
2.在查看代碼頁,輸入代碼
代碼如下,全部復制,Sub DeletePW()是代碼開始 End Sub 是代碼結束,中間是執行的代碼
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
3. 點擊查看代碼頁上藍色的運行即可,大功告成
參考文章: https://www.sohu.com/a/259773745_99966126