Private Sub Workbook_BeforeClose(Cancel As Boolean)
thisworkbook.Save
End Sub
this would go in the Thisworkbook module of the workbook.
Chip Pearson's page on events if you are not familiar:
http://www.cpearson.com/excel/events.htm
--
Regards,
Tom Ogilvy
"Varun Nair" wrote:
Hi
I want a code that could save the workbook if the user closes it!
--
Varun Nair