VBA knows that anything starting with a period is a property or a method of the object following the With : Object Variable Set « Data Type « VBA / Excel / Access / Word
VBA knows that anything starting with a period is a property or a method of the object following the With
Sub NewWorkbook() Dim myWorksheet As Worksheet
With Workbooks.Add
Set myWorksheet = .Worksheets.Add(After:=.Sheets(.Sheets.Count))
myWorksheet.Name = "January"
myWorksheet.Range("A1").Value = "Sales Data"
.SaveAs Filename:="YourExcel2007File.xlsx" End With End Sub