回覆列表
  • 1 # 使用者7554922179495

    在beforesave事件中遍歷usedRange,把每個formula不為空的單元格加鎖 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim sht As Worksheet, rC As Range For Each sht In Sheets sht.Unprotect With sht For Each rC In .UsedRange If rC.FormulaLocal <> "" Then rC.Locked = True Else rC.Locked = False End If Next End With sht.Protect Next End Sub 附件可參考

  • 中秋節和大豐收的關聯?
  • 海底兩萬裡在寫之時有沒有潛水艇?