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

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Sub Tri()
'
' Tri Macro
'
 
'
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"E2:E59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(255, 207, 55)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"F2:F59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(255, 0, 0)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"G2:G59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(197, 190, 151)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"H2:H59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(184, 204, 228)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"I2:I59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(217, 151, 149)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Clear
ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort.SortFields.Add(Range( _
"J2:J59"), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = _
RGB(178, 161, 199)
With ActiveWorkbook.Worksheets("Sommaire").AutoFilter.S ort
.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
PS : Je vous aurai bien laisé une copie de mon fichier mais impossible de joindre un .xlsm