操作步骤同上。
Public arr, celAdd
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim sj(), k%, i%, j%
k = -1
With Sheets("数据")
If IsEmpty(arr) Then Workbook_Open
tt = MsgBox("确定现在要保存工作薄吗?", vbQuestion + vbOKCancel, "提示")'如果觉得每次保存都要弹出提示麻烦,此句和下一句可以删掉
If tt = vbCancel Then Cancel = True
For Each cel In .Range(celAdd)
If cel