excel如何快速保护所有工作表或撤消所有工作表保护
时间:2022-09-25 21:06:18
有时需要让Excel工作簿中的每个工作表只能查看而不被修改,可以对所有的工作表进行保护,如果工作簿中的工作表数量较多,手动逐一操作十分繁琐。在工作表保护密码相同或不设置密码的情况下,用下面的方法可以快速保护所有工作表。
1.按Alt+F11,打开VBA编辑器。单击菜单“视图→立即窗口”,或按Ctrl+G打开“立即窗口”。
2.在“立即窗口”中输入下列代码,然后将光标定位到语句最后按回车键运行代码:
For Each ws In Worksheets : ws.Protect Password:="123" : Next ws
工作簿中所有的工作表即被保护,本例所设置的密码为“123”。如果要撤消所有工作表的保护,只需在立即窗口中输入下面的代码并回车运行:
For Each ws In Worksheets : ws.Unprotect Password:="123" : Next ws
标签:excel,如何,快速,保护,所有,工,作表,或,撤消
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
office2016打不开xlsx怎么办?Excel2016双击打不开xlsx的方法
2022-02-23 09:37:22
![](https://img.aspxhome.com/file/2023/5/41945_0s.jpg)
word2013如何使用批注?word中批注使用方法
2022-12-02 01:09:30
![](https://img.aspxhome.com/file/2023/3/25903_0s.jpg)
excel表格批怎么使用
2022-03-26 23:28:31
word符号栏怎么显示出来
2023-11-12 15:08:46
![](https://img.aspxhome.com/file/2023/0/17910_0s.gif)
Excel多个条件进行数据处理分析
2023-11-14 10:24:48
Win10热血无赖开始游戏闪退怎么办?
2023-12-05 13:28:36
![](https://img.aspxhome.com/file/2023/5/51225_0s.jpg)
Win10系统重装后没有Office软件怎么解决?
2022-04-12 23:14:03
![](https://img.aspxhome.com/file/2023/4/52654_0s.jpg)
WPS文字中打印预览功能使用技巧
2023-12-04 18:53:33
![](https://img.aspxhome.com/file/2023/9/a164079_0s.png)
Excel还可以生成和制作商品条码
2022-07-27 05:36:38
![](https://img.aspxhome.com/file/2023/7/a143287_0s.gif)
如何用Word2003文档修改作者信息?
2023-11-27 15:28:19
![](https://img.aspxhome.com/file/2023/2/18252_0s.jpg)
Power Pivot 中的数据分析表达式 (DAX)
2022-11-25 19:49:36
word怎么更改默认的度量单位?
2022-10-26 19:07:13
![](https://img.aspxhome.com/file/2023/6/23876_0s.jpg)
你的Win10 1909版本即将终止服务怎么办?
2023-11-23 17:59:02
![](https://img.aspxhome.com/file/2023/9/50629_0s.jpg)
在word文档中怎么进行画图呢?
2022-07-22 19:51:36
![](https://img.aspxhome.com/file/2023/3/23413_0s.jpg)
excel单元格大小怎么设置 excel指定单元格大小教程
2023-10-07 08:18:47
![](https://img.aspxhome.com/file/2023/3/a143403_0s.jpg)
excel表格的输入显示栏不见处理方法
2022-02-02 13:39:40
excel表格求和公式大全
2022-08-12 15:57:37
![](https://img.aspxhome.com/file/2023/0/a139980_0s.gif)
excel2010缺失solver.xla怎么办?solver.xla安装包下载
2023-07-22 02:43:20
![](https://img.aspxhome.com/file/2023/4/42904_0s.jpg)
Word中如何替换文字?word替换文字方法介绍
2022-09-04 07:13:54
![](https://img.aspxhome.com/file/2023/7/23387_0s.jpg)
excel2003柏拉图的制作教程
2022-04-14 04:22:27