Private Sub Workbook_BeforeClose(Cancel As Boolean)
If [a1] = "" Then
MsgBox "A1单元格为空,请输入数据,才可退出", , "提示"
Cancel = True
End If
If [a2] = "" Then
MsgBox "A2单元格为空,请输入数据,才可退出", , "提示"
Cancel = True
End If
End Sub 关闭时都有内容才通过.rar(7.99 KB, 下载次数: 5)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If [a1] = "" Then
MsgBox "A1单元格为空,请输入数据,才可退出", , "提示"
Cancel = True
End If
If [a2] = "" Then
MsgBox "A2单元格为空,请输入数据,才可退出", , "提示"
Cancel = True
End If
End Sub 关闭时都有内容才通过.rar(7.99 KB, 下载次数: 5)