hi
i have this code to run when a cell is entered with a number but i would like it to do 2 different macros based on the result of the question
Sub worksheet_change(ByVal target As Range)
Set target = Range("A3")
If target.Value > 2 Then
If MsgBox("Would you like to Print?", vbYesNo + vbQuestion) = vbNo Then Exit Sub
Range("a5").Select
Sheets("Cashout Print").Visible = True
Sheets("Cashout Print").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Reporting Form").Visible = False
Sheets("AML-CTF").Select
Range("a3").Select
ActiveCell.FormulaR1C1 = "1"
Range("a5").Select
End If
End Sub
i would like to add if the answer is no
Range("A3").Select
Selection.ClearContents
exit sub
but everytime it comes up with an error
am i mising a step????
i have this code to run when a cell is entered with a number but i would like it to do 2 different macros based on the result of the question
Sub worksheet_change(ByVal target As Range)
Set target = Range("A3")
If target.Value > 2 Then
If MsgBox("Would you like to Print?", vbYesNo + vbQuestion) = vbNo Then Exit Sub
Range("a5").Select
Sheets("Cashout Print").Visible = True
Sheets("Cashout Print").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Reporting Form").Visible = False
Sheets("AML-CTF").Select
Range("a3").Select
ActiveCell.FormulaR1C1 = "1"
Range("a5").Select
End If
End Sub
i would like to add if the answer is no
Range("A3").Select
Selection.ClearContents
exit sub
but everytime it comes up with an error
am i mising a step????