1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Sub ElapsedTime()
Dim StartTime As Double, EndTime As Double
'Stores start time in variable "StartTime"
StartTime = Timer
'Aggregation"
i = 2
j = 2
k = 4
Application.ScreenUpdating = False
For k = 8 To 11517
Application.StatusBar = (k - 8) * 100 / 11509 & "%" & " " & Format$(Timer - StartTime) & "s ecoulées " & " Temps restant estimé :" & (11517 - k) * Format$(Timer - StartTime) / k & "s" & "Durée total d'éxecution " & Format$(Timer - StartTime) + (11517 - k) * Format$(Timer - StartTime) / k
DoEvents
Sheets("MP").Select
Rows(k).Select
Application.CutCopyMode = False
Selection.Copy
Rows(3).Select
ActiveSheet.Paste
For i = 2 To 100
For j = 2 To 36
Sheets("Feuil1").Select
Cells(i, j) = Cells(i, j) + Worksheets(6).Cells(i, j).Value
Next j
Next i
Next k
Application.StatusBar = False
Application.ScreenUpdating = True
'Stores end time in variable "EndTime"
EndTime = Timer
'Prints execution time in the debug window
Debug.Print "Execution time in seconds: ", EndTime - StartTime
'Shows Message Box with elapsed time
MsgBox "Execution time in seconds: " + Format$(EndTime - StartTime)
End Sub |
Partager