|
楼主 |
发表于 2016-6-13 11:58
|
显示全部楼层
本帖最后由 乐乐2006201506 于 2016-6-13 12:02 编辑
老司机带带我 发表于 2016-6-13 09:01
不制定那些单元格是公式,将当前表格所有含有公式的单元格都隐藏:
谢谢您,您的代码中将我录制代码中下面代码删掉了。影不影响效果?我试了下,好像没有影响,是不是?
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
另外,我将密码添上了。您选中所有有公式的单元格的方法非常好,谢谢啦!
Sub 老司机() Dim rng As Range
With Sheet1
.Unprotect ("124")
.Cells.Locked = False
.Cells.FormulaHidden = False
Set rng = .Cells.SpecialCells(xlCellTypeFormulas, 23)
rng.Locked = True
rng.FormulaHidden = True
.Protect ("124")
End With
End Sub
|
|