Bonjour Rouge,
je viens de la tester quand j'efface il me dit qu'il y a un beug encore et en plus ma ligne qui doit etre en surbrillance ne fonctionne plus!!!
Je vais remettre l'ancienne.
petit question est ce que je dois mettre votre code dans fuil 1 NOUVEAU MODELE ou dans module 1 ou dans thisworkbook ?
Private Sub Worksheet_Change(ByVal Target As Range) ' Dans la colonne de M16 à M30 il va mettre un n°automatique par ordre d'enregistrement de panier
Application.EnableEvents = False
If Target.Value <> "" And Target.Column = 10 And Target.Row > 15 And Target.Row < 39 Then
Target.Offset(0, 3).Value = Application.WorksheetFunction.Max(Range("M16:M30")) + 1
ElseIf Target.Value = "" Then Target.Offset(0, 3).Value = ""
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'Dans la selection du tableau il va mettre en surbrillance la ligne
Set champ = Range("A16:M30")
If Not Intersect(champ, Target) Is Nothing And Target.Count = 1 Then
champ.Interior.ColorIndex = xlNone
col1 = champ.Column
col2 = col1 + champ.Columns.Count - 1
Range(Cells(Target.Row, col1), Cells(Target.Row, col2)).Interior.ColorIndex = 37
End If
End Sub