Creating a new worksheet for your workbook, and then it fills in several cells in that new worksheet. : Worksheet Add « Excel « VBA / Excel / Access / Word






Creating a new worksheet for your workbook, and then it fills in several cells in that new worksheet.

 
     Sub MyMacro()
         ActiveWorkbook.Worksheets.Add
         Range("A1").Value = "Company Report"
         Range("A2").Value = "Generated by an Excel macro"
         Range("A3").Value = "Generated for " & Application.UserName
     End Sub

 








Related examples in the same category

1.Add a new sheet with name in A1
2.Create a new sheet with month name and year as its name
3.Add a new Sheet
4.Inserts new monthly sheet
5.Add a worksheet and append value
6.Add a worksheet and save it
7.Append a worksheet to the end of the worksheet list