#1   Report Post  
Posted to microsoft.public.excel.programming
sd sd is offline
external usenet poster
 
Posts: 9
Default File Names

Can I save a file named ( yesterdays date ) using a macro.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default File Names

Try...
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\username\My
Documents\" & Format(Now() - 1, "yymmdd") & ".xls"

Frank

"sd" wrote:

Can I save a file named ( yesterdays date ) using a macro.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default File Names

Hi SD,

Try something like:

'=============
Sub aTester()
Dim strPath As String

'// CHANGE path to suit
strPath = "C:\Documents and Settings\" & _
"YOUR USERNAME\My Documents"

'// Or, to save to the default folder:
'strpath=application.DefaultFilePath

ActiveWorkbook.SaveAs _
Filename:=strPath _
& "\" & Format(Date - 1, "YYYYMMDD") & ".xls", _
FileFormat:=xlWorkbookNormal

End Sub
'<<=============


---
Regards,
Norman



"sd" wrote in message
oups.com...
Can I save a file named ( yesterdays date ) using a macro.



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
File names Augied Excel Worksheet Functions 3 January 14th 09 02:37 AM
Open Excel file get error with file names that have spaces in the Kozmo Setting up and Configuration of Excel 6 October 29th 08 02:51 AM
File Names [email protected] Excel Worksheet Functions 1 August 29th 06 12:46 PM
EXCEL97 FILE NAMES TRUNCATED TO THE FIRST LETTER IN THE FILE NAME Geoff Porter New Users to Excel 6 May 25th 06 08:31 PM
File names BOB Excel Programming 3 October 12th 04 01:43 AM


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