J'ai trouvé une solution pour le moment, il y a moyen de l'améliorer peut etre non?
Private Sub worksheet_change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub ' 1 seule case à la fois
' Zone surveillé de F8 jusqu'à la cellule F correspondante à la dernière ligne de G
If Not Intersect(Range("F7:F" & Range("G" & Rows.Count).End(xlUp).Row), Target) Is Nothing Then
If Target = "" Then Exit Sub ' Si cellule vide on quitte
' Vérifiaction si une date
If Not Target = "ok" Then
MsgBox "Vous devez saisir OK."
Exit Sub
End If
If MsgBox("Voulez vous vraiment valider cette tache ?", 36, "Confirmer") = vbYes Then
With Sheets("General")
' Recherche de la tâche en colonne G
Set cel = .Columns("G").Find(what:=Range("G" & Target.Row), LookIn:=xlValues, lookat:=xlWhole)
If Not cel Is Nothing Then
' Trouvé
ActiveSheet.Unprotect
.Rows(cel.Row).Hidden = True
End If
With Sheets("Janvier")
' Recherche de la tâche en colonne G
Sheets("Janvier").Select
ActiveSheet.Unprotect
Set cel = .Columns("G").Find(what:=Range("G" & Target.Row), LookIn:=xlValues, lookat:=xlWhole)
If Not cel Is Nothing Then
.Rows(cel.Row).Select
ActiveCell.Offset(, 5).Select
ActiveCell = Date
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
'le reste de mon code
Une optimisation possible pour ma recherche? Merci