赞
踩
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 只选锁定单元格
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.
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。