1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub Tri_Onglets()
Dim I&, F As Worksheet, d As Object, T As Variant, Flag As Boolean
Dim ActF As Worksheet
Set ActF = ActiveSheet
Set d = CreateObject("Scripting.Dictionary")
For Each F In Worksheets
If InStr(F.Name, "(") Then
d(Format(Split(Replace(F.Name, ")", ""), "(")(1), "000")) = F.Name
Else
Flag = True
End If
Next F
T = d.Keys
Call tri(T, 0, UBound(T))
Application.ScreenUpdating = False
For I = LBound(T) To UBound(T) - Not Flag
Sheets(d(T(I))).Move Before:=Sheets(I + 1)
Next I
ActF.Activate
End Sub |
Partager