Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
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
Macro to goto specific cell (todays date) crimekilla Excel Discussion (Misc queries) 4 May 11th 10 04:42 PM
Save file as todays date Rinto Syah Excel Discussion (Misc queries) 4 May 4th 09 11:39 AM
Save file with todays date ref#11235 [email protected] Excel Worksheet Functions 2 January 29th 09 06:59 PM
macro to: Add new sheet, then rename new sheet with todays date Paul Excel Worksheet Functions 3 September 29th 07 03:17 AM
What syntax do I use to add todays date in an excel macro Skeatt Excel Programming 3 January 11th 05 01:59 AM


All times are GMT +1. The time now is 06:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"