Sub NewWorkbook()
Dim myWorkbook As Workbook, myWorksheet As Worksheet
Set myWorkbook = Workbooks.add
With myWorkbook
Set myWorksheet = .Worksheets.add(After:=.Sheets(.Sheets.Count))
With myWorksheet
.name = "January"
.range("A1").value = "Sales Data"
End With
.SaveAs FileName:="YourExcel2007File.xlsx"
End With
End Sub
|