LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Appending Filename in Macro

Assuming you want to save the original file first then make a dated
'backup'.
Here's the code:

Sub wscpy()
Dim tdate As String
tdate = Format(Date, "mm.dd.yy")
ActiveWorkbook.Save
' this saves the workbook with the old filename

Dim FN As Variant
FN = ("C:\YourPath\ISG REPORT" & " " & tdate & ".xls")
'<=== Change "YourPath" to where you save the files
If FN < False Then
ActiveWorkbook.SaveCopyAs FN
End If
End Sub


This will save your original/template and make a copy of the
entire workbook with the name ISG REPORT 01.18.07.xls

Rob




Scott wrote:
Hello,

I want to do the following in a macro:

1. Open an excel workbook called ISG REPORT.xls
2. Do some changes to this workbook
3. Resave this workbook and append the filename with the current date so
that the new (and now archived) file will be ISG REPORT 01.19.07.xls
4. This is done generally weekly.

Question? In the macrom, when saving the new file, how do I append the file
with the current date?

Thanks!

Scott


 
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
Appending data from one spreadsheet to another using a macro DebP Excel Discussion (Misc queries) 3 December 1st 05 03:11 PM
Macro Help - Copying and appending data Louis Markowski Excel Worksheet Functions 1 September 16th 05 06:53 PM
Appending filename with date kapil.dalal Excel Programming 5 May 30th 05 11:34 AM
Excel – Macro Problem – Inserting, Appending Data, Deleting Aussiexcel[_3_] Excel Programming 0 August 25th 04 07:48 AM
Excel – Macro Problem – Appending Data Aussiexcel Excel Programming 3 August 24th 04 12:43 AM


All times are GMT +1. The time now is 04:38 PM.

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"