Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kodaco
 
Posts: n/a
Default How do I set the worksheet to save before closing?

When there is a change in a worksheet and I try to close it, a message asks
me whether I want to save the worksheet or not? How do I turn on this
notification before closing the sheet?
  #2   Report Post  
Anne Troy
 
Posts: n/a
Default

Open your workbook. Hit Alt+F11 or Tools--Macro--Visual basic editor
(VBE). On the left, double-click ThisWorkbook. Paste the following code into
the ThisWorkbook code window. Hit the Save diskette at top-left. Close the
VBE. Make a change to the workbook, and close it to test. Was the change
saved? Should be. :)

Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save

End Sub

*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"kodaco" wrote in message
...
When there is a change in a worksheet and I try to close it, a message

asks
me whether I want to save the worksheet or not? How do I turn on this
notification before closing the sheet?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I create a button to save one worksheet into a new workshe court Excel Discussion (Misc queries) 2 July 6th 05 06:39 PM
How do I save a filtered subset of a worksheet? quixoposto Excel Discussion (Misc queries) 2 June 25th 05 01:39 AM
How to save worksheet in .cvs format? Carlannie Excel Discussion (Misc queries) 1 April 21st 05 07:19 PM
how do i create and save a new file or worksheet autmatically ever DAN Excel Discussion (Misc queries) 0 March 30th 05 03:07 PM
Save? prompt when closing Excel MC Excel Discussion (Misc queries) 4 March 12th 05 10:55 PM


All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"