Hi!
I am wondering if someone can help me find a macro that will skip another macro based on another cell's value.
Currently I have the following macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Sheets("Sheet1").Range("D15").Value = "" Then
MsgBox "D15 requires user input."
Cancel = True 'cancels the save event
Exit Sub
End If
If Sheets("Sheet1").Range("D16").Value = "" Then
MsgBox "D16 requires user input."
Cancel = True 'cancels the save event
Exit Sub
End If
End Sub
I would like to skip these macros if let's say A1 in Sheet 2 has the value TRUE in it.
Is there a macro that allows that? And if so, where do I put that macro?
Thank you!
M.
I am wondering if someone can help me find a macro that will skip another macro based on another cell's value.
Currently I have the following macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Sheets("Sheet1").Range("D15").Value = "" Then
MsgBox "D15 requires user input."
Cancel = True 'cancels the save event
Exit Sub
End If
If Sheets("Sheet1").Range("D16").Value = "" Then
MsgBox "D16 requires user input."
Cancel = True 'cancels the save event
Exit Sub
End If
End Sub
I would like to skip these macros if let's say A1 in Sheet 2 has the value TRUE in it.
Is there a macro that allows that? And if so, where do I put that macro?
Thank you!
M.