Create and Save a new workbook

How to create and save a new workbook using VBA

METHOD 1. Create and Save a new workbook using VBA with a Save As dialog box

VBA

Sub Create_and_Save_Workbook()
'declare a variable
Dim wb As Workbook
Set wb = Workbooks.Add
'create and save a new workbook
FileToSaveName = Application.GetSaveAsFilename(InitialFileName:="Default Name", filefilter:="Excel Files(*.xlsx),*.xlsx,Excel-Macro Files (*.xlsm),*.xlsm")
wb.SaveAs FileToSaveName

End Sub

ADDITIONAL NOTES
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.

Explanation about how to create and save a new workbook

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to create and save a new Excel file using VBA.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to create a new excel file (workbook) using Excel, VBA and Shortcut methods
How to save a workbook using Excel, VBA and Shortcut methods
How to open a single workbook using Excel, VBA and Shortcut methods
How to save and close a workbook using VBA
How to save an Excel workbook without being prompted using VBA