Da_Silvy
This looks like a useful piece of code. I am wondering if you know what to put in this sub to stop it from closing. I mean sth like the equivalent of "Exit Sub" in VB.

What I want to do should look like this:

If Worksheets("Sheet1").Cells("A1").Value <> "" Then
MsgBox("You have data in cell A1. The program can't close.")
Exit Sub ' stops the close
End If

Is that possible?