PC Review


Reply
Thread Tools Rate Thread

how do I get a macro to save a sheet and set the file name?

 
 
=?Utf-8?B?TWFkYXNNYXg=?=
Guest
Posts: n/a
 
      16th Sep 2007
I have a spreadsheet that changes daily and needs to save the file
differently each day. The program wont allow you to "save as" then paste
something like the date as the file name. How do I get the macro to change
the filename each time it needs to save. This can be by and increment of say
1?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      16th Sep 2007
Here is a typical format for the save:

Sub saversion()
s = Format(Date, "yyyy_mm_dd")
ChDir "C:\Documents and Settings\Owner\Desktop"
ActiveWorkbook.SaveAs Filename:="DailyFile " & s
End Sub


If you run the macro today the file name would be :

DailyFile 2007_09_16.xls
--
Gary''s Student - gsnu200745


"MadasMax" wrote:

> I have a spreadsheet that changes daily and needs to save the file
> differently each day. The program wont allow you to "save as" then paste
> something like the date as the file name. How do I get the macro to change
> the filename each time it needs to save. This can be by and increment of say
> 1?
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Selects Directory to Save File Based on Sheet Criteria =?Utf-8?B?d2F0Y2h0b3dlcg==?= Microsoft Excel Programming 2 9th Aug 2007 04:08 PM
How can I save my sheet in macro =?Utf-8?B?RlN0MQ==?= Microsoft Excel Misc 2 10th Feb 2007 08:54 AM
Macro file save as, saving sheet not workbook annep Microsoft Excel Programming 15 21st Jan 2006 10:39 PM
How do I save each sheet as a separate .xls file by using macro? =?Utf-8?B?TWlu?= Microsoft Excel Programming 4 17th Feb 2005 08:11 PM
Macro to insert values from a file and save another sheet as a .txt file Frank Microsoft Excel Programming 2 28th Aug 2003 01:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 PM.