Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Si Target (ta sélection) comprend plusieurs cellules on sort.
If Target.Count <> 1 Then Exit Sub
'Si la ligne de Target est > à 5 ET que la colonne est C (3)
If Target.Row > 5 And Target.Column = 3 Then
'Si les 2 cellules à gauche de ta sélection ne sont pas vides, alors on continue
If Target.Offset(, -1) <> "" And Target.Offset(, -2) <> "" Then
'On inscrit la date dans ta sélection
Target = Date
'puis, on lance la macro EnvoiD avec les variables dest,dem et dét
'ces variables correspondent à tes données d'envoi
EnvoiD [L13] & ";" & [L11], Cells(Target.Row, 1), Cells(Target.Row, 2)
End If
'Idem pour la colonne E et EnvoiA
ElseIf Target.Row > 5 And Target.Column = 5 Then
If Cells(Target.Row, 3) <> "" And Target = "" Then
Target = Date
EnvoiA [L18], Cells(Target.Row, 1), Cells(Target.Row, 2), Cells(Target.Row, 5)
End If
End If
End Sub