Hey guys i'm having problems creating a result that displays me the estimated time left until my script is completed
the basics :
It's a simple script with a for from 1 to N rows
I've made a percent calculator in order to see where I am.
in order to the the code about how long it will take to finish i'm using the following code :
Sub CalculateRunTime_Seconds()
'PURPOSE: Determine how many seconds it took for code to completely run
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim StartTime As Double
Dim SecondsElapsed As Double
'Remember time when macro starts
StartTime = Timer
'*****************************
'Insert Your Code Here...
'*****************************
'Determine how many seconds code took to run
SecondsElapsed = Round(Timer - StartTime, 2)
'Notify user in seconds
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
End Sub
Estimates between different PC finish time : 130 seconds and 180 seconds.
My purpose is to display using the
percent = for_row / last_row * 100
Application.StatusBar = "Calculating data... " & percent & "% Completed"
'into
Application.StatusBar = "Calculating data... " & percent & "% Completed. Estimated time left : XXX seconds"
The estimated time left should be calculated on the speed of the percentage ?
Something like WinRAR?
Thank you
Bookmarks