0
votes

I want to call a count down timer from sub routine for each iteration of a FOR LOOP; where the duration of the timer is based on a value that it picks up from a cell in a range that the loop is cycling through.

For example, Cells A1:A5, have values 15,15,20,20,30 respectively. I want to run a macro that basically starts with A1, captures the 15 and then starts a countdown timer for 15 seconds and when it hits 0 it moves on to A2 and repeats the process.

it's not working as intended.

When I execute the main routine to cycle through the aforementioned range and call the Start_Timer routine (which in turn calls the Next_Moment routine until timer hit Zero and exits the sub) for each cell in the range, it appears to be cycling through the range perfectly and picking up the duration.

but when calls the Start_Timer routine it doesn't perform the timer countdown until after the loop has been cycled through completely and when it does the timer doesn't decrease in second intervals.

However if I place the call to Start_Timer outside of the loop the timer works correctly, but it obviously only runs the countdown timer once.

Any ideas?

I've tried using DoEvents before and after the call to Start_Timer and nothing.

1
consider adding some code. also avoid thank and similar pleasantries. if someone helps you on this forum, they are already doing it. - Jay

1 Answers

0
votes

Never mind all. I figured out how to get it to do what I needed to do. Now I need to figure out how to interupt/pause the timer by click a different button.