Figer une date dans excel
Résolu/Fermé
nathan01983
Messages postés
343
Date d'inscription
lundi 12 octobre 2009
Statut
Membre
Dernière intervention
15 février 2024
-
12 juin 2020 à 08:11
nathan01983 Messages postés 343 Date d'inscription lundi 12 octobre 2009 Statut Membre Dernière intervention 15 février 2024 - 12 juin 2020 à 10:31
nathan01983 Messages postés 343 Date d'inscription lundi 12 octobre 2009 Statut Membre Dernière intervention 15 février 2024 - 12 juin 2020 à 10:31
A voir également:
- Figer une date dans excel
- Liste déroulante excel - Guide
- Figer une colonne excel - Guide
- Aller à la ligne dans une cellule excel - Guide
- Déplacer une colonne excel - Guide
- Formule excel - Guide
2 réponses
Mike-31
Messages postés
18318
Date d'inscription
dimanche 17 février 2008
Statut
Contributeur
Dernière intervention
26 avril 2024
5 078
12 juin 2020 à 09:06
12 juin 2020 à 09:06
Bonjour,
par formule, impossible de figer la date, soit tu la saisis manuellement à la limite en cliquant en même temps sur Ctrl et ; (le point virgule) ou avec un code VBA si tu as quelques connaissances
par formule, impossible de figer la date, soit tu la saisis manuellement à la limite en cliquant en même temps sur Ctrl et ; (le point virgule) ou avec un code VBA si tu as quelques connaissances
nathan01983
Messages postés
343
Date d'inscription
lundi 12 octobre 2009
Statut
Membre
Dernière intervention
15 février 2024
11
12 juin 2020 à 10:31
12 juin 2020 à 10:31
Voici la sotution qu'on m'a apportée
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B6:B89")) Is Nothing Then
If Target.Value <> "" Then
Cells(Target.Row, 3).Value = Date
Else
Cells(Target.Row, 3).Value = ""
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Set vtarget = Intersect(Target, Columns(2))
If Not (vtarget Is Nothing) Then
For Each varea In vtarget
For Each vcell In varea
If Not (IsEmpty(vcell.Value)) Then
If vcell.Row > 5 Then
Range("C" & vcell.Row).Value = Now
End If
Else
Range("C" & vcell.Row).ClearContents
End If
Next
Next
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B6:B89")) Is Nothing Then
If Target.Value <> "" Then
Cells(Target.Row, 3).Value = Date
Else
Cells(Target.Row, 3).Value = ""
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Set vtarget = Intersect(Target, Columns(2))
If Not (vtarget Is Nothing) Then
For Each varea In vtarget
For Each vcell In varea
If Not (IsEmpty(vcell.Value)) Then
If vcell.Row > 5 Then
Range("C" & vcell.Row).Value = Now
End If
Else
Range("C" & vcell.Row).ClearContents
End If
Next
Next
End If
Application.EnableEvents = True
End Sub