1 2 3 4 5 6 7 8 9 10 11
| Dim Fichiers, Sh As Worksheet, NomFich As String
Fichiers = Array("Agence1", "region est", "region ouest", "region sud", "region idft")
For Each Sh In Worksheets
If Left(Sh.Name, 6) = "Agence" And IsNumeric(CInt(Mid(Sh.Name, 7, 1))) And Right(Sh.Name, 1) <= "c" And _
Right(Sh.Name, 1) >= "a" Then
If CInt(Mid(Sh.Name, 7, 1)) > 0 And CInt(Mid(Sh.Name, 7, 1)) < 6 Then
NomFich = Application.Index(Fichiers, CInt(Mid(Sh.Name, 7, 1)))
Sh.Copy Before:=Workbooks(NomFich & ".xls").Sheets(1)
End If
End If
Next Sh |
Partager