Trie feuilles de clacul

Bonjour,

Je souhaiterais trier mes feuilles de calcul par ordre alphabétique croissant, sauf la première feuille « feuille1 ».

Pour l’instant j’ai ce code dans un module :

Sub SortWorkBook()
'Updateby20140624
Dim xResult As VbMsgBoxResult
xTitleId = « KutoolsforExcel »
xResult = MsgBox(« Sort Sheets in Ascending Order? » & Chr(10) & « Clicking No will sort in Descending Order », vbYesNoCancel + vbQuestion + vbDefaultButton1, xTitleId)
For i = 1 To Application.Sheets.Count
For j = 1 To Application.Sheets.Count - 1
If xResult = vbYes Then
If UCase$(Application.Sheets(j).Name) > UCase$(Application.Sheets(j + 1).Name) Then
Sheets(j).Move after:=Sheets(j + 1)
End If
ElseIf xResult = vbNo Then
If UCase$(Application.Sheets(j).Name) < UCase$(Application.Sheets(j + 1).Name) Then
Application.Sheets(j).Move after:=Application.Sheets(j + 1)
End If
End If
Next
Next
End Sub

Merci d’avance,

si cette macro fonctionne, ajoutez ceci comme dernière ligne avant le « End Sub »

...
Worksheets("Feuille1").Move before:=Worksheets(1)
End Sub

Merci beaucoup, tout fonctionne

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.