打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Excel ActiveSheet.Protect 的属性

Excel ActiveSheet.Protect

 

DrawingObjects:=False,               能编辑对象

Contents:=True,                            内容

Scenarios:=False,                        能编辑方案

AllowFormattingCells:=True,          格式化单元格

AllowFormattingColumns:=True,   格式化列

AllowFormattingRows:=True,        格式化行

AllowInsertingColumns:=True,      插入列

AllowInsertingRows:=True,            插入行

AllowInsertingHyperlinks:=True,     插入超链接

AllowDeletingColumns:=True,        删除列

AllowDeletingRows:=True,            删除行

AllowSorting:=True,                       排序

AllowFiltering:=True,                      筛选

AllowUsingPivotTables:=True          透视表

password:="123"                           设置密码

另:

ActiveSheet.EnableSelection = xlUnlockedCells     只选未锁定单元格

ActiveSheet.EnableSelection = xlNoSelection       只选锁定单元格

 

EnableSelection   Remarks

This property takes effect only when the worksheet is protected:

xlNoSelection prevents any selection on the sheet,

xlUnlockedCells allows only those cells whose Locked property is False to be selected,

and xlNoRestrictions allows any cell to be selected.

Example

This example sets worksheet one so that nothing on it can be selected.

  1. With Worksheets(1)
  2. .EnableSelection = xlNoSelection
  3. .Protect Contents:=True, UserInterfaceOnly:=True
  4. End With

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
用VB操作excel方法汇总
搜集各种Excel VBA的命令供参考!
EXCEL中VBA基础应用
自学资料(Excel VBA)[收集整理2]
在delphi中操纵excel--[心笔留香]
Excel中如何动态改变可编辑区域?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服