Bonjour Luadix, le forum,
Un essai....
Code à placer dans le module de la feuille...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim nombre As Integer, dl As Integer, l As Integer, col As Integer
Dim plage As Range
dl = Sheets("Feuil1").Range("A" & Rows.Count).End(xlUp).Row
col = Cells(1, Cells.Columns.Count).End(xlToLeft).Column
Set plage = Range(Cells(4, 1), Cells(dl, col))
If Not Application.Intersect(Target, Range("E4:E" & dl)) Is Nothing Then
If Target.Count > 1 Then Exit Sub
cancel = True
l = Target.Row
On Error Resume Next
nombre = Application.InputBox("Combien de jours?")
If nombre = False Then Exit Sub
Rows(l).Interior.ColorIndex = xlNone
Target.Value = nombre: Range(Target.Address).Font.ColorIndex = 5
Range(Target, Cells(Target.Row, Target.Column + nombre)).Interior.ColorIndex = 5
plage.Sort key1:=Range("E4")
End If
End Sub
Cordialement,