Create a new version with an incremental version extension (for example adding "_v2" to the end of the file name) I decided to write VBA code for Excel as well as Miscrosoft Word and PowerPoint in case you would like to use the same process with your documents and presentations. Below are some useful articles related to VBA –, Copyright © 2020. The procedure will then save the file and close it leaving the user on the original sheet. Here we learn how to use save as a method to save an excel workbook along with examples & downloadable templates. The Cell Value which is used for file name is A1 and the extension is ".xlsx". When the macro is launched it opens a "Save as" dialogue box to allow the user to add a file path and name. 2) getting that date into the filename from a cell value Specify … The file format to use when you save the file. Sometimes we might want to save some of those new files (scratch pads), but don't have time to go through each file and save it with a name. This automatically creates a new workbook with a sheet in it of the same name as that from which it is copied. This will be new workbook data that I require to save as:- The file name of the new workbook should be named using 2nd row cell data and in this form - "ACCOUNT_YYMMDD_A_DD.csv". Steps: 1. A simple way to do what you want then is to copy the first sheet. I'm trying to create macro that will update and existing Word document which has embedded Excel objects into a PDF with a date stamp at the end of its name. We save workbook right, so it is important to mention the workbook name and its extension to use the Save As method. The above formula works great when you want to get a list of all the file names from a folder in Excel. My file takes two cells (F4) and (H20) to create a backup file. And this code should work for all the version of Microsoft Excel 2003, Excel 2007, Excel 2010, and Excel 2013. Step 3: Define a new variable which can hold the name by which the file to be saved as. Thanx and regards, Sujith The default file format for an Excel template for Excel 2007-2013. If you only want to add timestamp within the original file name instead of replacing it, please apply the below VBA code. Don’t worry, there’s a solution that you can use. VBA code: Save Excel file with specific cell value In this example we will see how to save Active Sheet and specific worksheet as new excel file using VBA. The Cell Value which is used for file name is A1 and the extension is ".xlsx". Macro is run every day so in the folder ABC there should be a new file saved every day with date as it's name. Objective. You can use the macro recorder to get the actually code generated. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm). The following VBA code may help you to save your workbook with a specified cell value, please do as follows: 1. The new workbook is getting saved with the macro running on the new workbook, but both workbook … It is a general task of saving work in the automation process. You can see that a file with the name “Example1” is being saved on Documents. How to Use This Macro. You want to create back up of these workbooks by saving them on the computer as one of the copy. Now mention the file format as “xlWorkbok.”. To use this macro, you can copy and paste it into a standard module: Activate the Visual Basic Editor by pressing ALT+F11. In the left navigation window select ThisWorkbook 4. Step 2: Define a new sub-procedure which can store a macro. The following is a simple Excel VBA example of copying data from the current workbook and saving the file to the desktop. If you could have noted down, the file is being saved as Macro-Enabled File, because the original file which I have used SaveAs function on is a file with Macro-Enabled. In that case, you can use a slightly different function. Login details for this Free course will be emailed to you, This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. we use Add, SaveAs, Close methods of Workbook. Ok, we are done. This has been a guide to VBA Save As. Wish to change the file name to current date. The answer is an absolute Yes! I have an XLS file with 1 sheet. If you are a frequent user of Microsoft Excel, you must have used Save As function under it, which allows you to save the currently opened workbook with a different name or different format (Excel Macro-enabled, CSV, PDF, etc.). Macro to Save and Close All Workbook and Automatically Name Files. Follow the below steps to convert this file into a PDF Using VBA Save As function: Step 1: Define a new sub-procedure to store a macro. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window. For a list of valid choices, see the XlFileFormat enumeration. If you'll need the macro only in the workbook where you created it, click Save or Save As like you normally would. ALL RIGHTS RESERVED. In the one and only step, the macro builds a new filename and uses the SaveCopyAs method to save the file in the Same folder. When you run this code, it works like the keyboard shortcut (Control + S). We have two kinds of saves in excel or any file; one is “Save,” and another one is “Save As.” Ctrl + S is the popular shortcut key as the Ctrl + C & Ctrl + V around the globe. In this method, you can define the file name and the path where you want to save the file, and apart from that, there are ten more arguments that you can define. Below are some useful excel articles related to VBA –, VBA Training (3 Courses, 12+ Projects). Lots of arguments right? Location path should be generic as more than 1 user will save sheet as PDF, and … Save a File to the Desktop with VBA. Approach. Steps: 1. The code examples below provide the VBA options to automate the creation of PDFs from Excel. Below are the different examples to save excel file using VBA Save As function. Right-click the project/workbook name in the Project window. Note 1: This VBA code will display a Save As dialog box where you can enter a name the new Excel file, select the file type and choose the location where you want to save the file. To save a file with a specific name by input box in VBA. Below is a simple VBA macro that will allow you to quickly turn your selected worksheet(s) into a PDF file in a snap. In addition, you can use a Microsoft Visual Basic for Applications macro to save the active workbook and use a variable for the file name. So, now you need to create a new workbook and save workbook using VBA Macro. It is. In Excel, you may be working on data that is so sensitive that you’ll want to save every time a particular cell or range of cells is changed. Using VBA Get a List of All the File Names with a Specific Extension. There are two methods to add a workbook. we use Add, SaveAs, Close methods of Workbook. Because your goal is to automate the creation of the workbook, you want to suppress that warning. I do have the tab name in one of the cells A1, using =cell("filename",A1) Example : sheet name week1, want to save new file as week1 I Can copy and paste into existing macro thanks in advance brian--Message posted via OfficeKB.com CFA Institute Does Not Endorse, Promote, Or Warrant The Accuracy Or Quality Of WallStreetMojo. And it is all up to us and our application which code we need to use. I wan put a hyphen between the two cells nd tried this: If you'll need the macro only in the workbook where you created it, click Save or Save As like you normally would. Currently macro saves a file with its existing name into a folder ABC. I would also like to close the new workbook, but keep the original workbook open. Now you can refer to the Workbook by it’s name: Designing report formats and specify the cell location where the sales name will be placed. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS. Password: Optional: Variant Click Insert > Module, and paste the following code in the Module Window. Now put backslash and enter the file name as per your wish with a file extension. I have a spreadsheet that includes a macro which saves a named print range as a pdf file. It will save the file. In the example shown, you want the workbook to […] © 2020 - EDUCBA. A. Follow the below steps to use Save As Function in Excel VBA: Step 1: Add a new module under Visual Basic Editor (VBE). I do not want the new file to overwrite the previously created excel files when the macro is run each time. To do so, we had placed a command button on a excel macro file, that command button was assigned the macro code to open and save … You can use variables from the ActiveWorkbook.Nameproperty, from input box data, or from a … Determine where the file is saved (or if it is saved at all) Create a new version with an incremental version extension (for example adding "_v2" to the end of the file name) I decided to write VBA code for Excel as well as Miscrosoft Word and PowerPoint in case you would like to use the same process with your documents … But what if you want to get the names of only the video files, or only the Excel files, or only the file names … Step 3: Run this code and you’ll see a pdf file generated under This PC > Documents. Press Alt+F11 to open VBA editor 3. Macro to Save and Close All Workbook and Automatically Name Files. Save a File to the Desktop with VBA. Close the VBA editor 6. I have seen the hints on a macro that saves current file with a filename that is listed in a particular cell. this works well, but I would like to modify the macro so that it will still pause on the "Save as" dialogue box to allow the user to select a file path for saving, but that will automatically build a filename using some standard text that I would add, append a value that exists in a cell of the original file, then adds the .pdf extension. Here we shall open a file, then a user input box will be shown.Post which we shall enter a new name, and that input is used while saving the file.In the image below we can see that we have provided user input as “Sample User Input”.So new saved workbook will have name as “Sample User Input.xlsx” Step2: then the “Visual Basic Editor” window will appear. I am recording macro and want to save the new macro- recorded sheet as the same name as the sheet tab. The code is written to save your document in the same folder as the Excel file currently resides. I'm trying to create a macro to save my spreadsheet with the filename as: filename1 (which is a cell with my name in it) & " Timecard" & Filename2 (which is a date in cell p4) My problems are: 1) getting VBA to recognize the date format from mm/dd/yyyy to mm-dd-yyyy. In the project window, find your project/workbook name and click the plus sign next to it to see all the sheets. You can change folder path and file name to suite your requirement. The code ranges from 1 line to 10 lines of code. From a VBA perspective, it is the ExportAsFilxedFormat method combined with the Type property set to xlTypePDF that creates a PDF. We are having Save As function under VBA as well which helps us to do all these above-mentioned tasks along with some additional benefits (obviously automating things is one of the benefits). Although, a file can be saved just by pressing the shortcut key Ctrl+S. The XML-based and macro-enabled file format for Excel 2007-2013. Like Workbook is the expression against which SaveAs can be used. Begin by opening the Visual Basic Editor by pressing ALT-F11 on the keyboard.. Press Alt+F11 to open VBA editor 3. So when you try to save it, Excel prompts you with … If you need to make modifications, hopefully, you will be able to follow along with This code is going to save the workbook “Book6” into the folder that is saved on my desktop with the name “myFIle.xlsx”. However, it is true that these are the arguments that make VBA SaveAs more flexible function to use. There may be times when you need to ask the user to select a location to save a file. Suppose you have a data as given below in your excel sheet and you need to convert it into PDF. But here’s one thing that you need to take care of: IF you already have a workbook with the same name then it will replace that file with the new one. Let us see an example macro VBA Create Folder and save new file in the newly created folder. How do I make a macro that will save a file name that looks like a date i.e. By default, the file saved using VBA SaveAs will be saved under the format same as that of the original file. VBA code: Save an Excel … I like the way you think. In this code, ActiveSheet.SaveAs allows the file to be saved with the same name. Excel Techniques for Sorting Teams in a Group Round (Part 1) How to use the functions of data handling using VLOOKUP Excel function; How to work with logical functions (IF) Using Intersection to Create a Range in Excel VBA; Screen Updating using VBA in Excel; Save Workbook as New File using VBA in Excel However, is it possible to use the same function under VBA? This Word macro will save the ActiveDocument with a new file name that includes the current time: Sub SaveMewithDateName() 'saves active doc in current folder as a filtered html and named upon current time Dim strTime As String strTime = Format(Now, "hh-mm") ActiveDocument.SaveAs FileName:=ActiveDocument.Path … Explanation about how to create and save a new workbook The below code will help you save all the workbooks as a copy. Wasn’t it? To do that, I would suggest at the end of your macro, right before you save your workbook to the new file name, you would copy the tabs to a new workbook. But it is not that familiar with the concept “Save As.” In regular worksheet shortcut key to Save As the file is the F12 key. I think these parameters are enough to understand the Save As method. “Expression” at the start of the syntax is nothing but an expression against which this function can be used. CFA® And Chartered Financial Analyst® Are Registered Trademarks Owned By CFA Institute.Return to top, Excel functions, Formula, Charts, Formatting creating excel dashboard & others, * Please provide your correct email id. See how it has been achieved in the screenshot below. They can be used on their own or as part of larger processes. 2003-04-15.xls. The new created Excel file will be saved with the name of current timestamp directly. Then a Save As dialog box pops up, you can see the timestamp displaying in the File name box. For example, after I work on my file called "File1", I would like to run a macro that saves this file as "File1_XS" in the same folder. After all the work, we wish to save the file. This is like hitting the Excel eject button when we don't want to lose any of our work. It is painful to lose the data we have worked on. Step 5: Write down a statement which gets evaluated for the given IF condition. But it is not that familiar with the concept “Save As.” In regular worksheet shortcut key to Save As the file is the F12 key. Placing the macro here allows it to run each time you make any change to the sheet: Activate Visual Basic Editor by pressing Alt+F11. In VBA, too, we can save the file as “Save As.”. To save the workbook using vba code we use the object Workbook with the SaveAs function. Step 1: Define a new sub-procedure under newly inserted module which can store the macro. Nor do I want to be asked if I want to overwrite the existing file. Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more. SaveAs method saves workbook in the specified folder. So mention the workbook you are saving. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy, New Year Offer - VBA Training Course (6 courses, 35+ hours video) View More, You can download this VBA Save As Excel Template here –, 3 Courses | 12 Hands-on Projects | 43+ Hours | Full Lifetime Access | Certificate of Completion. In the editor window enter the code below 5. VBA code to add a workbook. this is good. SaveAs runs VBA save as command on excel. Save the file as Macro Enabled File 7. This is a guide to VBA Save As. You can use those exact same methods to identify workbooks when using Save … The following YouTube video shows you how to save a file to the desktop with VBA. For Example, a user may add some extra special character (which are allowed in naming conventions) or can add dates as well under the file name. And in that macro, you need to specify the workbook that you want to save and then use the SAVE method. It is the code to add a new workbook using VBA in Excel 2016. PDF was then and continues to be, a common file format for distributing documents. You can use the macro recorder to get the actually code generated. You can also create a new Workbook and immediately save it: Workbooks.Add.SaveAs Filename:="NewWB" This will save the Workbook as an .xlsx file to your default folder (ex. Use the following VBA code: Private Sub SaveWorkbookAsNewFile (NewFileName As String) Dim ActSheet As Worksheet Dim ActBook As Workbook Dim CurrentFile As String Dim NewFileType As String Dim NewFile As String Application.ScreenUpdating = False ' Prevents screen refreshing. This can be done using a save file dialog. Excel Binary Workbook.xlsb. Public Sub renameWorkbook() Name "C:\Users\WYMAN\Desktop\test.xlsx" As "C:\Users\WYMAN\Desktop\test2.xlsx" End Sub. Open a new file 2. I am running a Macro: ExportWithFormatting to export report data to an excel spreadsheet. To save a file with a specific name by input box in VBA. But saving a workbook with macros is a little different because it needs to be in a special "macro-enabled" file format. Add method helps to create new workbook. How do I include the current date in the File name as it is saved … There are several different methods for creating a save file dialog. The following is a simple Excel VBA example of copying data from the current workbook and saving the file to the desktop. This default location can be provided explicitly at the time of defining sheet name. My Documents). This code read Workbook named as “Sales 2019.xlsx” to save. The reason for this variable being defined as Variant is, this data type makes Naming conventions versatile. The binary file format (BIFF12) for Excel 2007-2013. In this article, we will learn how to add a new workbook and save it using Excel vba. Follow the below steps to use Save As Function in Excel VBA. It will save the file in D drive > Folder Name (Articles) > Sub Folder Name (2019). This section contains the base code to save Excel as PDF from different objects (workbooks, worksheets, ranges and charts). Instead of defining name initially, is it possible to write a code which allows a user to save the worksheet by the name of his choice same as Excel Save As function? I do have the tab name in one of the cells A1, using =cell("filename",A1) Example : sheet name week1, want to save new file as week1 I Can copy and paste into existing macro thanks in advance Assume you are working with 10 workbooks on your computer. The process of presenting a dialog box to open files can be accomplished by accessing a built-in method of the Application object. Also, by default, the file will be saved in Documents under This PC. You can also save the file in a different folder using this method. Step 5: Now, use SaveAs function with FileName argument in order to save the file as with name “Example1”. The name of each saved file is the same as that of the sheet name it had in the main file. Appreciate a lot for your help. When you want to work with more than one workbook, it is necessary to use the loops. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy, You can download this VBA Save As Excel Template here –, 3 Online Courses | 13 Hands-on Projects | 45+ Hours | Verifiable Certificate of Completion | Lifetime Access. Similarly, to replicate the workbook we are working on can be created by using the “Save As” method. Step 2: Now, use the following code to save this file as a PDF file. Note that the file name can be changed, but the file path of the current file and new file must be the same; otherwise it is a copy file, not rename file. Keep in mind that a save file dialogs doesn't actually save anything. It means that this function in VBA automatically checks the file format of the previous file and saves it in the same format. Here we shall open a file, then a user input box will be shown.Post which we shall enter a new name, and that input is used while saving the file.In the image below we can see that we have provided user input as “Sample User Input”.So new saved workbook will have name … Write Res Password: Mention reserved password for the workbook. Step 6: This is it, now run this code by hitting F5 or manually using the Run button and see the output. Let’s see how we can save the current workbook with a different name. Thanks. Brandon To Save file with Cell Value in Excel, you need to write down an Excel VBA Macro to achieve the result. Hi I am recording macro and want to save the new macro- recorded sheet as the same name as the sheet tab. In the editor window enter the code below 5. The new created Excel file will be saved with the name of current timestamp directly. 1. However, you can specify the directory manually at the time of defining file name. That’s right — Excel warns you that there is already a file with that name and then asks if you want to overwrite the previously existing file. Use Excel Macro To Save A File To A Specific Location And With Cell Derived File Name - Hi everyone I am a novice when it comes to Macros... - Free Excel Help Step 7: As soon as you run this code, you’ll get Save As dialogue box which will allow you to type in the name of your choice and save the file. Excel VBA Articles. However, it can also be defined as per user requirement at the time you define the variable. Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more, This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. I think these parameters are enough to understand the Save … In this article, we will see an outline on Excel VBA Save Workbook. This is like hitting the Excel eject button when we don't want to … I am new to VBA and need help how to proceed with creating a command button that saves as PDF on desktop. One is recommended and the other one is not. Save a macro with the current workbook. The following YouTube video shows you how to save a file to the desktop with VBA. Current VBA code: "Sub X (item As Outlook.MailItem) Dim SaveFolder As String Dim Y As … VBA code to save Sheet as New Workbook Here is the Example VBA syntax and Example VBA code to save a Sheet as New Workbook. Approach. The above formula works great when you want to get a list of all the file names from a folder in Excel. You can change folder path and file name to suite your requirement. Here is what I have so far. The name of each sheet will change according to the sales name that has been determined in the same location on each sheet. Issue I have a macro code to save a file name to a form. In the left navigation window select ThisWorkbook 4. But saving a workbook with macros is a little different because it needs to be in a special "macro-enabled" file format. In Microsoft Excel, you can save a file to any drive to which you have write and delete privileges. In this example we will see how to save Active Sheet and specific worksheet as new excel file using VBA. Excel VBA Save Workbook. Simple. Once you are done with actual calculations or task, at end of the procedure we generally call a procedure to export or Save the Output File to … Hi, I need a macro to "save as" my excel file with an extension to file name "_XS" in the same file path. This will ensure the macro is saved and works when you open this file next. Go to Insert and then select Module. Add method helps to create new workbook. Let us see an example macro VBA Create Folder and save new file in the newly created folder. I would like the macro to copy rows that have 'ab' in the column B (with title BR)and save it in a new excel file with name ab.xlsx in the same location folder. Just do the following steps: Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut. Own or as part of larger processes password: Optional: Variant the XML-based and file! Is valid as per your wish with a new workbook and save new file the. Write Res password: mention reserved password for the workbook for distributing Documents from a … Hi there the.... One of the syntax macro to save excel file with new name nothing but an expression against which this function can be.. In VBA Sub X ( item as Outlook.MailItem ) Dim SaveFolder as Dim. –, Copyright © 2020 you ’ ll see a PDF file Excel button... Newly inserted Module which can hold the name user enters is valid as per your with. Run this code is going to have a look into different examples to save Excel file VBA! Timestamp displaying in the Module window accessing a built-in method of the syntax is nothing but an expression against this! File next a dialog box pops up, you need to save then... The user-defined name this piece of code gets evaluated once the if condition is true according to desktop... These are the arguments that make VBA SaveAs more flexible function to.... End of the user-defined name below in your Excel sheet and specific worksheet as new Excel file data! Workbook to save your document in the newly created folder a method to save and Close all workbook and workbook. Now use the save as a.xlsx file ( with the macro running on the computer as one of number... Macro, you want to add a new workbook using VBA save as you! Is necessary to use the loops ExportAsFilxedFormat method combined with the name of current timestamp directly when we n't... Piece of code > Module, and Excel 2013 Excel files when the recorder... Quality of WallStreetMojo project window, find your project/workbook name and then use the assignment operator to assign name. Suppress that warning generated under this PC > Documents will get saved the... Skipped while using VBA, you need to save a file default save location for file. We learn how to save as like you normally would forces the workbook using.... Of sheets instead, you can use this macro, you need to ask the user on the new,. Code to add timestamp within the original file name macro with macro to save excel file with new name property! My file takes two cells ( F4 ) and ( H20 ) to create a backup file the name current. Folder as the sheet tab several different methods for creating a command button that saves current file with a.... Arguments are Optional and can be saved as data from the current workbook and saving the file are. Renameworkbook ( ) name `` C: \Users\WYMAN\Desktop\test.xlsx '' as `` C: \Users\WYMAN\Desktop\test.xlsx '' as C! You try to save the new workbook using Excel VBA example of copying data from the workbook! File ( with the macro only in the workbook where you created it, isn ’ t macro to save excel file with new name cell! ( which will be replaced with the same folder as the Excel file using VBA your! ’ t it, the file name to current date if to make sure name! To lose any of our work Excel file to the desktop with the SaveAs method lose the we... The sheet name below in your Excel sheet and you ’ ll see macro to save excel file with new name! Specific extension procedure will then save the file, the file name together date. Syntax is nothing but an expression against which this function in VBA Automatically the! The macro recorder to get the actually code generated: End the IF-loop and this. Plus sign next to it to see the image above for your reference function under VBA will. Code will help you save all the version of Microsoft Excel 2003, Excel 2007, Excel prompts with... Seen the hints on a macro: ExportWithFormatting to export report data an... Condition is true can also save the file you are saving > Sub name... Get a list of valid choices, see the output Excel, you can see that a save file does! One is recommended and the extension as.pdf at the start of the same name as does not Endorse Promote... This method i am new to VBA and need help how to as... Given if condition you open this file as with name “ Example1 ” being... Ensure the macro running on the new workbook, you need to write down a statement which evaluated... Worked on store VBA macro t it: write down a statement which gets for. Run this code read workbook named as “ sales 2019.xlsx ” to save Active sheet and specific as. Example and downloadable Excel template for Excel 2007-2013 a simple Excel VBA save as a.xlsx (... Under newly inserted Module which can hold the name “ Example1 ” is being saved on Documents VBA! This data Type makes Naming conventions time of defining file name it into a folder in Excel, you the! The timestamp displaying in the main file, and paste it into a standard Module: Activate Visual... Youtube video shows you how to use save as function in Excel, Mobile Apps Web! Eject button when we do n't want to get a list of all the hard work we worked... Which is used when you open this file, and paste the following code to save a file to desktop. Dim Y as … 1 code below 5 same file name to your. File regardless of the sheet tab this method a macro with the name Define in Spreadsheet_Name! Save a file to be in a special `` macro-enabled '' file format been to! New workbook and Automatically name files see that a save as dialog box macro to save excel file with new name up, can! Added the extension as.pdf at the End of the workbook where you created it, prompts. Manually using the run button and see the timestamp you run this code to see the output ….... Exportasfilxedformat method combined with the current workbook and Automatically name files the conventions. File and Close it leaving the user on the new macro to save excel file with new name is saved! Are going to save as function default, the file format for an Excel workbook along with &. File will be this PC > Documents we identified all the file name to a form file the. Your project/workbook name and its extension to use the save as dialog box pops up you... In step 5: write down a statement which gets evaluated once the condition! Article, we macro to save excel file with new name to change the file format by accessing a built-in of. As … 1 methods for creating a save file dialogs does n't actually save anything several methods. Works when you want to work with more than one workbook, you specify...: Variant the XML-based and macro-enabled file format for an Excel workbook along with an and. Make sure the name of your choosing ) extension to use the following video. By hitting F5 or manually using the “ save As. ” would also like to Close the new workbook the. Hitting F5 or manually using the SaveAs function, we wish to change the file with! Training ( 3 Courses, 12+ Projects ) the previous file and Close all and! Button that saves current file can be used on THEIR own or as part of larger processes examples... But an expression against which SaveAs can be saved as actually save anything End IF-loop! Specific name by input box data, or Warrant the Accuracy or Quality of WallStreetMojo a sheet in that,... Now mention the file format for macro to save excel file with new name Documents of copying data from the ActiveWorkbook.Nameproperty, from input in! Very easy to create back up of these workbooks by saving them on the new workbook is saved. Argument in order to save an Excel workbook along with an example macro VBA create folder save!.Xlsx file ( with the SaveAs method and specify the directory manually at the of!, there’s a solution that you want to add timestamp within the original file name to a location! Mind that a file into PDF file by pressing the shortcut key Ctrl+S ) Sub! Make VBA SaveAs more flexible function to use the loops that case, you specify..., please apply the below steps to use this code should work for the. In order to save Active sheet and specific worksheet as new Excel file it! Which the file saved using VBA SaveAs will be saved with the property! Possible to use when you open this file as a.xlsx file ( the! Want to add a new variable which can store a macro.pdf at the time you Define variable! Allows you to Define a range of cells that, when changed, forces the workbook using VBA Editor”. On each sheet will change according to the desktop VBA –, VBA Training 3. 2019 ) running a macro for saving a workbook with a FileName that is in! As part of larger processes make sure the name “myFIle.xlsx” has been achieved in same... Your project/workbook name and then use the save method the format same as that of the copy valid! > Documents example we will see how to save a file into.... Keyboard shortcut ( Control + S ) steps to use function to use it had in the newly created.. Vba SaveAs will be user-defined ): write down a statement which gets once..., there’s a solution that you want to suppress that warning current workbook with a extension! Function along with examples & downloadable templates seen the hints on a macro code or Excel macro...