Je reviens vers toi Thau Théme car j'ai un nouveau problème.
Lorsque je copie le code que tu m'as envoyé sur une page vierge cela fonctionne très bien. Mais quand je le copie à la suite d'un autre code existant, j'ai un message d'erreur : ERREUR DE COMPILATION NOM AMBIGU DETECTE : WORK SHEET CHANGE
Ci joint les 2 codes, je pense qu'il y a incompatibilité entre les 2.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("n")) Is Nothing Then
If Target.Count > 1 Or Target.Row < 4 Then Exit Sub 'à partir ligne 4
If Target = "" Then 'si efface "N"
Target.Offset(0, 3).ClearContents 'efface date
Else 'sinon
Target.Offset(0, 3) = Now 'date décaler de 3 colonnes
End Sub
Private V As Byte
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
V = ActiveCell.Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 6 Then
If IsNumeric(Target.Value) Then
If Target.Value >= 1 And Target.Value <= 54 Then Cells(Target.Row, 1).Resize(Target.Value, 11).Interior.ColorIndex = Target.Value + 2
End If
If Target.Value = "" Then Cells(Target.Row, 1).Resize(V, 11).Interior.ColorIndex = xlNone
End If
End Sub
Peux tu y jeter un œil ?
Merci d'avance
Cordialement, largoj