Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dolphinv4
 
Posts: n/a
Default Macro to auto save file using the format YYMM

Hi,

I recorded a macro that automatically saves a file then change the formula
in cell A1 to today's date, ie =today(), then save the file. I have a problem
with the last part...is there any way I can set the macro such that the file
will be saved as "c:\YYMM ABC" where 'YYMM' is the format of the date
(probably can be taken from cell A1) and 'ABC' is my own file name?

Thanks!
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

You can get the date right in the code:

dim myFileName as string
myfilename = "C:\" & format(date,"yymm") & " ABC.xls"

activeworkbook.saveas filename:=myfilename, fileformat:=xlworkbooknormal

Dolphinv4 wrote:

Hi,

I recorded a macro that automatically saves a file then change the formula
in cell A1 to today's date, ie =today(), then save the file. I have a problem
with the last part...is there any way I can set the macro such that the file
will be saved as "c:\YYMM ABC" where 'YYMM' is the format of the date
(probably can be taken from cell A1) and 'ABC' is my own file name?

Thanks!


--

Dave Peterson
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 do I save a column to a file (in ascii format) joe Excel Discussion (Misc queries) 4 June 26th 05 12:59 AM
Macro to save a file as ynissel Excel Discussion (Misc queries) 4 May 26th 05 02:48 PM
Macro to save a file as a PDF ynissel Excel Discussion (Misc queries) 8 May 25th 05 10:46 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
format question when open csv file Jeff Excel Discussion (Misc queries) 1 December 1st 04 06:53 PM


All times are GMT +1. The time now is 04:17 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"