Re : réactivation du calcul automatique
merci camarche pas de chercher la solution(j 'avais envisagé aussi le faite qu' il relisais la commande "manual" ou qu' il ne lisais pas la commande "auto", mais sans savoir pourquoi...
)
je suis pas sur d 'avoir compris ton explication
tu voudrai que je mettre une boucle avec une tempo supérieur a la durée de l exécution de la macro avant la ligne
Application.EnableEvents = True
si c'est bien ça j 'ai fait mais c 'est toujours pareil (Passage en "sur ordre")
Public flag As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
Application.Calculation = xlManual
If Target.Address <> "$E$3" Then Exit Sub
Application.EnableEvents = False
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 Application.EnableEvents = True: Exit Sub
'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"): Application.EnableEvents = True: Exit Sub
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)
Dim FinTempo As Long
Application.Calculation = xlAutomatic
FinTempo = Timer + 10 'en secondes
Do
DoEvents
Loop Until Timer > FinTempo
Application.EnableEvents = True
End Sub