Sheet In New Workbook property of Appliction Object

  • One of the property that Application Object consits of is: Sheets in New Workbook
  • Through this property user can define number of worksheets required when new workbook being added
  •  

    Click on below mentioned image to watch the video:

     

    Code:

    Sub Define_the_Number_Of_Worksheets_In_NewlyCreatedWorkbook()
    Dim W As Integer
    For W = 1 To 5
    If W = 1 Then
    Application.SheetsInNewWorkbook = 4
    ElseIf W = 2 Then
    Application.SheetsInNewWorkbook = 11
    ElseIf W = 3 Then
    Application.SheetsInNewWorkbook = 25
    ElseIf W = 4 Then
    Application.SheetsInNewWorkbook = 15
    ElseIf W = 5 Then
    Application.SheetsInNewWorkbook = 9
    End If
    Workbooks.Add
    Next
    Application.SheetsInNewWorkbook = 3
    End Sub

    Download the Workbook