Hi All, I am trying to save a file with a name given in a cell D12 in sheet1 and with the current date. (eg: Report - 28/8/2014 Thanks in advance.
Hi, Try the below code You may need to change the path Code:
Hi Sathish, But I also want the current date with the file name.
Hi, Try the below code Code:
Iam getting an error stating wrong number of arguments or invalid property assignment. And this error occurs in the key word "Format".
Hi, Try this Note: File name will not accept "/" Code:
Thank you so much Sathish. This works fine... We often need a distinct name to save our Excel files. This allows us to find our desired file among many other files. What could be more distinct than a specific date? In this article, we will discuss how to use Excel VBA to save a workbook in a specific folder with a date. Download the Practice WorkbookYou can download the practice workbook from here. 3 Easy Examples to Save Workbook in Specific Folder with Date Using Excel VBAIn this article, we will present 3 very easy VBA codes to save our Excel file as a date. Firstly, we will store our dataset as the current date. In the next one, we will conserve the Excel file as the date of the day before the current date. In the final example, we will apply a VBA to save our Excel file as the current date and time. We will use the following sample dataset to demonstrate the examples. 1. Saving Folder as Current DateIn this example, we will use a VBA code to save our Excel workbook as the current date. We will use the Datefunction in the VBA code to do so. Steps:
Read More:Excel VBA Save as File Format (12 Suitable Examples) 2. Saving Folder as Previous DayIn this instance, we will use a VBA code to save our Excel workbook as the previous date. We will subtract one from the Date attribute in the VBA code to do so. Steps:
Read More: How to Save Excel Macro Files as Filename from Cell Value Similar Readings
3. Saving Folder as Today’s Date with TimeIn this demonstration, we’ll save our Excel workbook with the current date and time using a VBA script. We will use the NOW function in the VBA code to do so. Steps:
Read More: Excel VBA: Save Workbook as New File in Same Folder ConclusionIn this article, we have discussed three simple VBA codes that allow us to save our Excel workbook as a date in a specific folder. These will help the users to give their Excel files distinct names, so they can manage the files efficiently. Related Articles
How to save File name with date in VBA?Formatting today's date and time into a text string that can be used in a filename is achieved using the FORMAT function, obvious when you think of it. The format to use is as follows: Format( Now(), “DD-MMM-YY”)
How do I save a File name with date and time?Manual Rename. Right-click on the saved file.. Select "Rename" from the drop-down menu.. Rename the file including the date. Use dashes to separate portions of the name: the Windows operating system excludes certain characters from file names, but not dashes. If the file name is "examplefile.. How do I save a workbook with a date in VBA?How to save file with date and time in Excel?. Save Excel file with date and time by using VBA code.. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.. Click Insert > Module, and paste the following code in the Module Window.. How to add date and time to File name in VBA?In Excel vba we can create new file or save the current workbook with different name.. Parse File name & its extension.. Get today Date & Time.. Format as per use preference.. Add formatted Date-Time-Stamp before file extension.. Save the file.. |