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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
Sub Régions()
Application.DisplayAlerts = False
Set NewBook = Workbooks.Add
NewBook.SaveAs "C:\CHEMIN\Chiffres individuels IDF.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
NewBook.SaveAs "C:\CHEMIN\Chiffres individuels Est.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
NewBook.SaveAs "C:\CHEMIN\Chiffres individuels Ouest.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Workbooks.Open Filename:= "C:\CHEMIN\Chiffres individuels Est.xlsx"
Workbooks.Open Filename:= "C:\CHEMIN\Chiffres individuels IDF.xlsx"
Workbooks.Open Filename:= "C:\CHEMIN\Chiffres individuels Ouest.xlsx"
Windows("Fichier source reportings.xlsx").Activate
Set MFA = Workbooks("Fichier source reportings.xlsx").Worksheets("Montants financés et ass")
D = MFA.Cells(MFA.Rows.Count, "A").End(xlUp).Row
For L = D - 1 To 7 Step -1
nom_onglet = MFA.Cells(L, 1).Value
Cells(L, 2).Select
Selection.ShowDetail = True
ActiveSheet.Name = nom_onglet
If Sheets("Régions").Range("A1:A100").Find(nom_onglet) Then
Sheets(nom_onglet).Move Before:=Workbooks("Chiffres individuels Est.xlsx"). _
Sheets(1)
End If
If Sheets("Régions").Range("B1:B100").Find(nom_onglet) Then
Sheets(nom_onglet).Move Before:=Workbooks("Chiffres individuels Ouest.xlsx"). _
Sheets(1)
End If
If Sheets("Régions").Range("C1:C100").Find(nom_onglet) Then
Sheets(nom_onglet).Move Before:=Workbooks("Chiffres individuels IDF.xlsx"). _
Sheets(1)
End If
MFA.Activate
Next L
End Sub |
Partager