Currently my code is basically as below but the finishing time pops up and the background queries are still running.
I want them to run but I want the timer to consider them instead of ignoring them.
I want them to run but I want the timer to consider them instead of ignoring them.
Code:
Sub CalculateRunTime_Minutes()
'PURPOSE: Determine how many minutes it took for code to completely run
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim StartTime As Double
Dim MinutesElapsed As String
'Remember time when macro starts
StartTime = Timer
'*****************************
'All Pivot Tables and equations Refresh
ActiveWorkbook.RefreshAll
DoEvents
'*****************************
'Determine how many seconds code took to run
MinutesElapsed = Format((Timer - StartTime) / 86400, "hh:mm:ss")
'Notify user in seconds
MsgBox "This code ran successfully in " & MinutesElapsed & " minutes", vbInformation
End Sub