Public flag As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$E$3" Then Exit Sub
Application.EnableEvents = False
Application.Calculation = xlManual
tx = [E3]
lig = 8
[A8:M400].ClearContents
'Stop
Set plage = Sheets("base de donnée").Range("T2:T150")
For Each cel In plage
flag = 0
k = cel.Value
If k = "" Then GoTo S
'Stop
For Each sh In ActiveWorkbook.Sheets
If sh.Name = k Then a = sh.Name: flag = 1: Exit For
Next sh
If flag = 0 Then MsgBox ("La feuille " & k & " n'existe pas, Faire les modif nécessaires"): GoTo S
With Sheets(k).[N106:N226]
Set a = .Find(tx, LookIn:=xlValues)
If Not a Is Nothing Then
firstAddress = a.Address
Do
Cells(lig, 1) = Sheets(k).Cells(a.Row, 13)
Cells(lig, 2) = Sheets(k).Cells(a.Row, 15)
Cells(lig, 3) = Sheets(k).Cells(a.Row, 1)
Cells(lig, 4) = Sheets(k).Cells(a.Row, 2)
Cells(lig, 5) = Sheets(k).Cells(a.Row, 3)
Cells(lig, 6) = Sheets(k).Cells(a.Row, 4)
Cells(lig, 7) = Sheets(k).Cells(a.Row, 5)
Cells(lig, 8) = Sheets(k).Cells(a.Row, 6)
Cells(lig, 9) = Sheets(k).Cells(a.Row, 7)
Cells(lig, 10) = Sheets(k).Cells(a.Row, 12)
Cells(lig, 11) = Sheets(k).Cells(a.Row, 9)
Cells(lig, 12) = Sheets(k).Cells(a.Row, 11)
Cells(lig, 13) = Sheets(k).Cells(a.Row, 8)
lig = lig + 1
Set a = .FindNext(a)
Loop While Not a Is Nothing And a.Address <> firstAddress
End If
End With
'End If
Next ' limite au dela de laquelle le calcul ce remet bien mais trop tôt ( ralentisement)
S:
Application.Calculation = xlAutomatic ' met en place le calcul automatique Marche pas
Application.EnableEvents = True
End Sub