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

  • Initiateur de la discussion Initiateur de la discussion ivanovitch
  • Date de début Date de début

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 !

I

ivanovitch

Guest
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
Assurez vous de marquer un message comme solution pour une meilleure transparence.

Discussions similaires

  • Question Question
XL 2021 listbox
Réponses
18
Affichages
645
Réponses
17
Affichages
1 K
Réponses
11
Affichages
940
Réponses
6
Affichages
1 K
B
  • Question Question
Réponses
2
Affichages
751
Benjy51190
B
Réponses
1
Affichages
900
L
Réponses
9
Affichages
1 K
Retour