Sub Worksheet_Change(ByVal Target As Range)
Dim FinNom As Long
Dim x, y As Date
FinNom = ActiveSheet.Range("A7").End(xlDown).Row
x = Cells(9, ActiveCell.Column).Value
y = Cells(FinNom + 3, ActiveCell.Column).Value
If Target.Column < 25 Then Exit Sub 'si avant colonne 25 on sort de la procédure
If Target.Row < FinNom Then ' si saisie avant la ligne située avant finnom
Select Case Target.Value
Case ""
ActiveCell.Offset(1, 0) = ""
Case "P"
ActiveCell.Offset(0, 0) = x 'Cells(9, 0).Value
Case "X"
ActiveCell.Offset(0, 0) = x 'Cells(9, 0).Value
Case "A"
ActiveCell.Offset(0, 0) = ""
End Select
If Target.Row > FinNom Then ' si saisie avant la ligne située après finnom
Select Case Target.Value
Case ""
ActiveCell.Offset(1, 0) = ""
Case "P"
ActiveCell.Offset(0, 0) = y 'Cells(FinNom + 3, 0).Value
Case "X"
ActiveCell.Offset(0, 0) = y 'Cells(FinNom + 3, 0).Value
Case "A"
ActiveCell.Offset(0, 0) = ""
End Select
End If
End If
End Sub