Salut Philippe, Moncef,
pour le plaisir, en VBA,
Private Sub Workbook_Open()
'
Cells(1, Columns.Count) = Cells(1, Columns.Count - 1).End(xlToLeft).Column
'
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'
iRow = UsedRange.Rows.Count
'
Application.EnableEvents = False
Application.ScreenUpdating = False
'
If Not Application.Intersect(Target, Range("Z3:Z" & iRow)) Is Nothing Then
iCol = Cells(1, Columns.Count - 1).End(xlToLeft).Column
sCol = Split(Columns(iCol).Address(ColumnAbsolute:=False), ":")(1)
Range("A" & Target.Row & ":" & sCol & Target.Row).Interior.Color = IIf(IsNumeric(Cells(26, Target.Row)) = True, RGB(220, 230, 190), xlNone)
End If
'
If Target.Row = 1 Then
iCol1 = Cells(1, Columns.Count - 1).End(xlToLeft).Column
If iCol1 <> Cells(1, Columns.Count) Then
sCol1 = Split(Columns(iCol1).Address(ColumnAbsolute:=False), ":")(1)
iCol = Cells(1, Columns.Count)
sCol = Split(Columns(iCol).Address(ColumnAbsolute:=False), ":")(1)
For x = 3 To iRow
If Range("A" & x).Interior.Color = RGB(220, 230, 190) Then
Range("A" & x & ":" & sCol & x).Interior.Color = xlNone
Range("A" & x & ":" & sCol1 & x).Interior.Color = RGB(220, 230, 190)
End If
Next
Cells(1, Columns.Count) = iCol1
End If
End If
'
Application.EnableEvents = True
Application.ScreenUpdating = True
'
End Sub
A+