Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
Hello,
can someone help me, I can write a macro to save the file as a single referenced cell, but can anyone help me in creating a macro which either within the macro or by referencing a cell returns a file named as "PA2005-01-05" or the date for the current day. I have used '=now()' in say cell A1 but am not sure how to put this through a macro to give me a file name saved as the format "PA2005-01-05", please any help, many thanks Andy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
Andy
Something like ActiveWorkbook.SaveAs _ Filename:="PA" & Format(Now(), "yyyy-mm-dd") & ".xls" Will save it to the default folder -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Momo" wrote in message ... Hello, can someone help me, I can write a macro to save the file as a single referenced cell, but can anyone help me in creating a macro which either within the macro or by referencing a cell returns a file named as "PA2005-01-05" or the date for the current day. I have used '=now()' in say cell A1 but am not sure how to put this through a macro to give me a file name saved as the format "PA2005-01-05", please any help, many thanks Andy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
MyFile = "PA" & Format(Date,"yyyy-mm-dd") & ".xls"
-- HTH RP (remove nothere from the email address if mailing direct) "Momo" wrote in message ... Hello, can someone help me, I can write a macro to save the file as a single referenced cell, but can anyone help me in creating a macro which either within the macro or by referencing a cell returns a file named as "PA2005-01-05" or the date for the current day. I have used '=now()' in say cell A1 but am not sure how to put this through a macro to give me a file name saved as the format "PA2005-01-05", please any help, many thanks Andy |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
may this help
sub savingfile() 'this eg i wish to save file in folder named c:\data MyFileName = "C:\DATA\PA" & Date & ".XLS" ActiveWorkbook.SaveAs Filename:=MyFileName, FileFormat:=xlNormal _ , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False End Sub My e-mail : |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
fName = "PA" & format(date,"yyyy-mm-dd") & ".xls"
-- Regards, Tom Ogilvy "Momo" wrote in message ... Hello, can someone help me, I can write a macro to save the file as a single referenced cell, but can anyone help me in creating a macro which either within the macro or by referencing a cell returns a file named as "PA2005-01-05" or the date for the current day. I have used '=now()' in say cell A1 but am not sure how to put this through a macro to give me a file name saved as the format "PA2005-01-05", please any help, many thanks Andy |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using macro to save as todays date
Thanks all, the 1st reply worked great thanks,
Cheers for all the replies Andy "Tom Ogilvy" wrote: fName = "PA" & format(date,"yyyy-mm-dd") & ".xls" -- Regards, Tom Ogilvy "Momo" wrote in message ... Hello, can someone help me, I can write a macro to save the file as a single referenced cell, but can anyone help me in creating a macro which either within the macro or by referencing a cell returns a file named as "PA2005-01-05" or the date for the current day. I have used '=now()' in say cell A1 but am not sure how to put this through a macro to give me a file name saved as the format "PA2005-01-05", please any help, many thanks Andy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to goto specific cell (todays date) | Excel Discussion (Misc queries) | |||
Save file as todays date | Excel Discussion (Misc queries) | |||
Save file with todays date ref#11235 | Excel Worksheet Functions | |||
macro to: Add new sheet, then rename new sheet with todays date | Excel Worksheet Functions | |||
What syntax do I use to add todays date in an excel macro | Excel Programming |