gpt4 book ai didi

excel - 在电子表格受密码保护时允许组展开/折叠。即使在关闭文件之后

转载 作者:行者123 更新时间:2023-12-03 17:09:43 31 4
gpt4 key购买 nike

在使用如下标准代码保护公式时:

Sub TestMe

dim myCell as range

with Worksheets(1)
For Each myCell In .Range("A1:R102").Cells
If myCell.MergeArea.Cells.Count = 1 Then
If myCell.HasFormula Then
myCell.Locked = True
Else
myCell.Locked = False
End If
End If
Next myCell

.EnableOutlining = True
.Protect "v", contents:=True, userinterfaceonly:=True

End With

End Sub
一切似乎都很好,公式受到保护,Excel 分组似乎很实用。但是,在关闭文件并再次打开后,如果我尝试按分组上的 +,它不想工作,并给出以下消息:

You cannot use this command on a protected sheet. To use this command, you must first unprotect the sheet (Review tab, Changes group, Unprotect Sheet button). You may be prompted for a password.


我可以运行相同的代码来取消保护它,然后再保护它, 但是 这个想法是:
  • 使用 Excel 文件,无需 VBA
  • 带配方保护
  • 带功能分组

  • 我正在使用 MS Office Professional Plus 2013 32 位。
    有没有办法做到这一点?甚至手动?我从字面上选择了所有复选框,但没有成功:
    enter image description here

    最佳答案

    打开 excel 文件并在 Review 下转至 Protect Sheet并确保选择:Select locked cells Select unlocked cells并且为了展开/折叠列的分组 Format columnsFormat Rows 的行相同.应该这样做:) Here录屏

    关于excel - 在电子表格受密码保护时允许组展开/折叠。即使在关闭文件之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65847631/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com