I have a User Form which includes a button 'Close Form'. This clears all the data entered on the form and on a worksheet.

If the user closes the form using the 'X' button at the top right of form, the code doesn't work.

How can I get the code to work when the 'X' button is used?


Thanks