Timer

  • Thread starter Thread starter TJ
  • Start date Start date
T

TJ

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!
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top