Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) For Each C In Range("XXX").Cells If C.Value = "" Then MsgBox "請將內容填寫完整后再保存!" Cancel = True Exit Sub End If Next End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) For Each C In Range("XXX").Cells ‘在名稱xxx中循環(huán)判斷 If C.Value = "" Then MsgBox "請將內容填寫完整后再保存!" ‘如有空白出現(xiàn)提示 Cancel = True ’退出保存界面 Exit Sub ’退出過程 End If Next End Sub