Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the code to save a file as a csv which name is today's date? I'm
using Excel 2007. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi LuisE
See http://www.rondebruin.nl/saveas.htm Use FileExtStr = ".csv": FileFormatNum = 6 -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "LuisE" wrote in message ... What is the code to save a file as a csv which name is today's date? I'm using Excel 2007. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You didn't say what format you would want the date in (remembering, of
course, that you can't use slashes in a file name) nor whether you were trying to save a single worksheet or the entire workbook. Assuming you wanted to only save a single worksheet, you could use this code line to do what you asked (note that the $ sign on the Date function call is required; also, change the directory path from my example "d:\temp" to wherever you actually want to save it at).... Worksheets("Sheet1").SaveAs "d:\temp\" & Date$ & ".csv", xlCSV Or you can make your own date format string using the Format function, something like this... Worksheets("Sheet1").SaveAs "d:\temp\" & Format(Date, _ "ddmmmyyyy") & ".csv", xlCSV You may want to look up the SaveAs method in the help files as there are additional options available. -- Rick (MVP - Excel) "LuisE" wrote in message ... What is the code to save a file as a csv which name is today's date? I'm using Excel 2007. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Reading File Name in VB Macro that contains today's date | Excel Discussion (Misc queries) | |||
Save As file name + Today's Date using a macro | Excel Programming | |||
Open file saved as today's date | Excel Programming | |||
Export a file with today's date | Excel Programming |