Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A2:A100")) Is Nothing Then
With Target(1, 7)
.Value = Date
End With
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
With Target(1, 7) 'G1
If IsNumeric(Target) Then .Value = Date
End With
End If
If Not Intersect(Target, Range("B1:E1")) Is Nothing Then
If Not IsNumeric(Target) Then Range("H1").Value = Date
End If
End Sub
Bonjour le fil,
Un code à adapter à votre besoin
si une saisie à lieu dans la colonne A, la date s'affiche dans la cellule correspondante en G
VB:Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("A2:A100")) Is Nothing Then With Target(1, 7) .Value = Date End With End If End Sub
merci c est top
Peut on faire disparaitre la date quand la cellule est vide?Et comment faire pour figer une date auto dans colonne H si colonne C,D,E,F,=FINI?
Peut-on mettre cette condition et la 1ere ensemble?
Merci pour ton retour. Quand j'ecris "FINI" il m'insére pas la date, sais-tu pourquoi?Re,
Une proposition
Ton exemple est sur une ligne. comment faire pour plusieurs ligne? Peux-tu m'aiguiller?Re,
Si la cellule A1 est vide la procédure n'inscrit pas La date et il faut respecter la casse, "Fini". Ça peut être changé dans le code.
Pour le reste il faut fournir la totalité des contraintes. Le code ne sera pas le même.
un classeur avec le résultat attendu et les contraintes.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
If IsNumeric(Target) Then Target.Offset(1, 7).Value = Date ' Colonne G
End If
If Not Intersect(Target, Range("B1:E100")) Is Nothing Then
If Target.Value = "FINI" Then Target.Offset(1, 8).Value = Date 'Colonne H
End If
End Sub