Hello!
I have a macro that does something pretty simple - prints one sheet to PDF and saves another sheet in a new workbook. I've basically automated a payment workbook using a bunch of formulas, but one of the cells is a dropdown that must be manually populated.
I would like something at the very beginning of the code where a message box would pop up and essentially kill the macro if cell E2 is blank.
I’m sure I just need to add something about exiting the sub after the if/then statement but I’m stuck.
Thank you!!
I have a macro that does something pretty simple - prints one sheet to PDF and saves another sheet in a new workbook. I've basically automated a payment workbook using a bunch of formulas, but one of the cells is a dropdown that must be manually populated.
I would like something at the very beginning of the code where a message box would pop up and essentially kill the macro if cell E2 is blank.
Code:
Sub CheckPmtType()
If Range("E2").Value = ”” Then MsgBox "Please select a payment type"
Else Call PrintToPDF
End Sub
I’m sure I just need to add something about exiting the sub after the if/then statement but I’m stuck.
Thank you!!