ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timer (https://www.excelbanter.com/excel-programming/303591-timer.html)

tj

Timer
 
Hello,

I was wondering how I could set an internal time process
into a macro. Such as how long the macro has been running.

My thought is to display a progress bar that will show the
macros percentage of completion. From a response I
received yesterday (Thank You), I would like to use
something similar to what is on the site http://www.j-
walk.com/ss/excel/tips/tip34.htm.

My only problem is determining how the percentage is
calculated - my thought is to test how long the macro
takes to run - then write that time into my code -
subtracting that time from the amount of time the macro
has been running. But how could I setup this internal
timer?

Any alternative suggestions would also be greatly
appreciated.

Thank You!





Mark Thorpe[_3_]

Timer
 
Hi TJ -

There's a VBA function called Timer which returns number of seconds since
midnight. You could call this once at the beginning of the function to save
the initial value, than call it periodically later to calculate number of
seconds elapsed since the start.

Mark

"TJ" wrote in message
...
Hello,

I was wondering how I could set an internal time process
into a macro. Such as how long the macro has been running.

My thought is to display a progress bar that will show the
macros percentage of completion. From a response I
received yesterday (Thank You), I would like to use
something similar to what is on the site http://www.j-
walk.com/ss/excel/tips/tip34.htm.

My only problem is determining how the percentage is
calculated - my thought is to test how long the macro
takes to run - then write that time into my code -
subtracting that time from the amount of time the macro
has been running. But how could I setup this internal
timer?

Any alternative suggestions would also be greatly
appreciated.

Thank You!








All times are GMT +1. The time now is 04:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com