Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Erreur d'Exécution 5 en mode partagé seulement

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

ivanovitch

XLDnaute Nouveau
Bonjour,
J'ai un souci avec une macro qui me sert à trier plusieurs colonnes suivant l'affichage des couleurs. Le problème est que ça fonctionne très bien avant que je partage le fichier.
Si vous avez des explications ou même des solutions...
Merci d'avance

Sub Tri()
'
' Tri Macro
'

'
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"E2:E59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(255, 207, 55)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"F2:F59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(255, 0, 0)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"G2:G59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(197, 190, 151)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"H2:H59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(184, 204, 228)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"I2:I59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(217, 151, 149)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort.SortFields.Add(Range( _
"J2:J59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(178, 161, 199)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
End Sub
 

Pièces jointes

- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
17
Affichages
878
Réponses
11
Affichages
712
Réponses
6
Affichages
925
Réponses
1
Affichages
782
Réponses
1
Affichages
1 K
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…