我需要包含计时器功能来计算从WbtoWb2到WbtoWb10运行宏所需的总时间...需要包含哪些代码?
Sub ComparisonTemplate()
Call WbtoWb2
Call WbtoWb3
Call WbtoWb4
Call WbtoWb5
Call WbtoWb6
Call WbtoWb7
Call WbtoWb8
Call WbtoWb9
Call WbtoWb10
End Sub
答案 0 :(得分:4)
记录开始时间,计算结束时间与记录的开始时间之间的经过时间......
Sub ComparisonTemplate()
Dim startTime : startTime = Now()
Call WbtoWb2
Call WbtoWb3
Call WbtoWb4
Call WbtoWb5
Call WbtoWb6
Call WbtoWb7
Call WbtoWb8
Call WbtoWb9
Call WbtoWb10
MsgBox "Finished in " & DateDiff("s", startTime, Now()) & " seconds."
End Sub