1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub OK_Click()
CreerOnglets [ComboTyperapport]
End Sub
Sub CreerOnglets(TypeRapport As String)
Dim SheetsNames, i As Long, S As Long
SheetsNames = Array("Rapport MTM", "Swap", "Financement stucturé", _
"Placement", "Top 10 Client", "Top 10 Deal", "Top 10 Variation")
With Application
S = .SheetsInNewWorkbook
If TypeRapport = "All" Then
.SheetsInNewWorkbook = UBound(SheetsNames) + 1
Else
.SheetsInNewWorkbook = 2
SheetsNames(1) = TypeRapport
End If
With Workbooks.Add
For i = 1 To Application.SheetsInNewWorkbook
.Sheets(i).Name = SheetsNames(i - 1)
Next
.SaveAs Filename:="Rapport_MTM.xls"
End With
.SheetsInNewWorkbook = S
End With
End Sub |
Partager