'Code VBA: Créer un nouveau classeur avec un nombre spécifique de feuilles de calcul
Sub MakeWorkbook()
Dim xOldCount As Integer
Dim xNewCount As Variant
xOldCount = Application.SheetsInNewWorkbook
xNewCount = Application.InputBox("How many sheets in the new workbook do you want?", "Kutools for Excel", , , , , , 1)
If xNewCount = False Then Exit Sub
If (xNewCount < 1) Or (CLng(xNewCount) > 255) Then
MsgBox "The number must between 1 and 255!"
Exit Sub
End If
With Application
.SheetsInNewWorkbook = xNewCount
.Workbooks.Add
.SheetsInNewWorkbook = xNewCount
End With
End Sub