Re : Coloration de lignes
Bonjour a tous,
Merci pour les différentes solutions apportées qui complèteront ma précédente demande. La macro de Gorfael couplée à une MFC feront parfaitement l'affaire.
Si toutefois quelqu'un pouvait adapter la macro de Gorfael à excel 2007, ce serait parfait.
Code :
Sub Macro1()
Dim Cel As Range, Plage As Range, Coul As Long, x
Set Plage = Range([A2], Cells(Cells(Rows.Count, "A").End(xlUp).Row, _
Cells(1, Columns.Count).End(xlToLeft).Column))
Plage.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
Plage.Interior.ColorIndex = xlNone
For Each Cel In Plage.Columns(1).Cells
If Cel <> Cel.Offset(-1, 0) Then
If Cel.Offset(-1, 0).Interior.ColorIndex = xlNone Then
Coul = 36
Else
Coul = xlNone
End If
Else
Coul = Cel.Interior.ColorIndex
End If
Range(Cel, Cells(Cel.Row, Plage.Columns.Count)).Interior.ColorIndex = Coul
Next Cel
End Sub
Encore une fois mille merci à tous pour votre aide et pourvu que ça dure...