Private Sub Worksheet_Change(ByVal Target As Range)
t = Timer
What = Target.Offset(0, -1).Value
Set f = Worksheets("annuel")
col1 = "F"
col2 = "AP"
Ligne = 11
For i = 1 To 12
For kk = f.Cells(Ligne, col1).Column To f.Cells(Ligne, col2).Column
If f.Cells(Ligne, kk).Value = What Then
Set result = f.Cells(Ligne, kk)
For j = result.Row + 2 To result.Row + 9
If UCase(f.Cells(j, "C").Text) = UCase(Target.Parent.Name) Then
f.Cells(j, result.Column).Value = Target.Value
ok = True: Exit For
End If
Next
If ok = False Then
MsgBox Target.Parent.Name, , "Pas trouve"
Exit Sub
Else
'MsgBox Target.Parent.Name, , "OK Trouve"
Exit For
End If
End If
Next
Ligne = Ligne + 14
If ok = True Then Exit For
Next
duree = Timer - t
If ok = False Then
MsgBox What, , "Pas trouve"
End If
End Sub