Creates new workbook from current Worksheet:   Return to List

' copies sheet DataTemplate from this workbook into new workbook; deletes all other sheets

Set wb = Workbooks.Add
ThisWorkbook.Sheets("DataTemplate").Copy Before:=wb.Sheets(1)
For i = wb.Sheets.Count To 2 Step -1
    wb.Sheets(i).Delete
Next i
wb.Sheets(1).Name = "Sheet1"

See also:
Built-In Dialogs and Argument Lists
Closing a Workbook (with options)
Deleting a Workbook (i.e., File)
Filename of the active Workbook (full path/name)
File Open Dialog (for browsing and selecting files)
File SaveAs Dialog (for saving files)
Opening a Workbook (known filename)
Saving a Workbook without Dialogs
Working with Workbooks



Note to Webmaster