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
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