grotsblues
XLDnaute Occasionnel
Bonsoir le forum
J'ai écrit ce code que je dois exécuter sur une feuille qui contient plus de 650 000 lignes et celui-ci est très lent. Pouvez-vous m'aider car je ne comprend pas pourquoi ?
Merci pour vos réponses
Sub statutEetM()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim derligne As Long
derligne = range("A2").End(xlDown).Row + 1
For ligne = 3 To derligne
If range("AF" & ligne).Value = "E" Or range("AF" & ligne).Value = "M" Then
range("AK" & ligne).Value = "NON"
Else: range("AK" & ligne).Value = "OUI"
End If
Next ligne
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
J'ai écrit ce code que je dois exécuter sur une feuille qui contient plus de 650 000 lignes et celui-ci est très lent. Pouvez-vous m'aider car je ne comprend pas pourquoi ?
Merci pour vos réponses
Sub statutEetM()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim derligne As Long
derligne = range("A2").End(xlDown).Row + 1
For ligne = 3 To derligne
If range("AF" & ligne).Value = "E" Or range("AF" & ligne).Value = "M" Then
range("AK" & ligne).Value = "NON"
Else: range("AK" & ligne).Value = "OUI"
End If
Next ligne
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub