Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a single worksheet as new file before close


I am trying to get my workbook to export or save a single worksheet as
new file each time the main workbook closes . . . is this possible?
am trying to date and time stamp each newly created file as well so
can have a history of changes made on that one sheet . . . the reason
am doing this is because the workshhet is updated weekly and I woul
like to keep the past data on record instead of it being deleted eac
time someone types in a cell . . . I'm sure there is some simple cod
to do this that I am not understanding . . . thanks in advance for an
help on this matter

--
MD
-----------------------------------------------------------------------
MDC's Profile: http://www.excelforum.com/member.php...fo&userid=3439
View this thread: http://www.excelforum.com/showthread.php?threadid=54171

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Saving a single worksheet as new file before close

You could add something like this in the Workbook Close event:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheet3.Copy
ActiveWorkbook.Close True, ThisWorkbook.Path & "\Export_" & Format(Now,
"YYYYMMDDHHMMSS")
Application.ScreenUpdating = True
End Sub

This should create a copy of the worksheet in the working folder. The name
includes a date/time stamp as well.



"MDC" wrote:


I am trying to get my workbook to export or save a single worksheet as a
new file each time the main workbook closes . . . is this possible? I
am trying to date and time stamp each newly created file as well so I
can have a history of changes made on that one sheet . . . the reason I
am doing this is because the workshhet is updated weekly and I would
like to keep the past data on record instead of it being deleted each
time someone types in a cell . . . I'm sure there is some simple code
to do this that I am not understanding . . . thanks in advance for any
help on this matter.


--
MDC
------------------------------------------------------------------------
MDC's Profile: http://www.excelforum.com/member.php...o&userid=34391
View this thread: http://www.excelforum.com/showthread...hreadid=541710


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
Close file without saving Mike Excel Programming 1 December 5th 07 02:15 AM
Programatically close a file without saving [email protected] Excel Programming 2 December 26th 04 01:23 AM
Close file without saving Roadie[_4_] Excel Programming 0 October 22nd 04 03:21 PM
Close file without saving Roadie[_3_] Excel Programming 1 October 22nd 04 02:53 PM
Close file without saving data ExcelMonkey[_96_] Excel Programming 2 March 2nd 04 11:34 PM


All times are GMT +1. The time now is 10:09 AM.

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

About Us

"It's about Microsoft Excel"