End Macro if cell is blank, continue if populated

  • I have a functional code, however it now requires one more criteria. I need to check at the beginning of this code to determine if cell I1 (on "Main", codename sheet2) is populated. This cell contains a date that is used in the renaming of the sheet tabs s well as the actual workbook. If I1 is blank, I need the macro to display a message box stating "Please enter the Payroll Date into cellI1", and the code should be exited. Now if cell I1 contains a date, then the macro should run.


  • Hello,


    You could test the following :



    Hope this will help :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Carim,


    PERFECT! I had tried a few things, but my syntax was off, so the script ran, message box appeared, b ut when OK was clicked, scripted continued. Thanks to your revision, it is exactly what I needed. Thank you so very much!

  • Glad you could solve your problem ...


    Thanks for your Thanks ...AND for the Like :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!