Script to backup and rename excel workbook

L

lobster

I plan to use a row delete script (I have this already) to get rid of
old data here at work. Before I run this though (I will be running it
fairly frequently) I thought I should backup the file I am working on.

Is it possible to write a script which creates a backup of the current
Excel file I am working on, without changing the filename of the 'live'
workbook, and which names the backup file with the time and date so it
is both unique and also searchable (EG 03122003-1645.xls or similar) ?

Ideally I would combine the two scripts so that once the script is run
a backup is created and then the rows are deleted subject to my
criteria. Basically if I forget to back up and then delete the data in
error it could cost me my job.

Any thoughts welcome !!
TIA
 
D

Don Guillett

Here is a sub I use to make a backup from any folder I am in. Modify to
suit.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub

--
Don Guillett
SalesAid Software
[email protected]
lobster said:
I plan to use a row delete script (I have this already) to get rid of
old data here at work. Before I run this though (I will be running it
fairly frequently) I thought I should backup the file I am working on.

Is it possible to write a script which creates a backup of the current
Excel file I am working on, without changing the filename of the 'live'
workbook, and which names the backup file with the time and date so it
is both unique and also searchable (EG 03122003-1645.xls or similar) ?

Ideally I would combine the two scripts so that once the script is run
a backup is created and then the rows are deleted subject to my
criteria. Basically if I forget to back up and then delete the data in
error it could cost me my job.

Any thoughts welcome !!
TIA
creating financial statements
 
Top