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.

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

 

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值