I want to perform a validation on a column. The validation is that X should start with 0.
When data is entered and when closing the excel sheet, it should throw an error message saying the data is incorrect and it should not allow me to close until and unless I correct the data.
I have put the code in Before Close. It is showing the error message if data is incorrect, but closing before we change the incorrect data.
Also tried with Before save. It is same behaviour found.
Any help or suggestion is appreciated.
Thanks,
Jaya Vignesh Kannan
I believe that the Workbook_Before_Close macro has a ‘Cancel’ parameter. You could then do something like this: