Excel VBA - Time loop

preview_player
Показать описание
A simple video showing how to get a code to repeat itself every second.

Here is the code from the video:
Рекомендации по теме
Комментарии
Автор

Terrific! That is what is was searching for!

TonVermeij
Автор

Hi, great vid. thanks for posting.
I'm trying to make it run faster, e.g. call the "main" sub every 1/2 second rather than every 1 second. I tried dividing the "TimeValue("00:00:01")" by 2, but it doesn't work. Any ideas?

The code I tried was something like this:

Sub timer()

Application.OnTime Now() + TimeValue("00:00:01")/2, "main"

End Sub

Gingerbreadaddict
Автор

Very good but it does accept only integer seconds
what if i need fractions

MohMoh
Автор

Will the counter continue even when excel is closed?

michaelhawkins
Автор

This is what i was looking for Thank you so much!

harshilkaswala
Автор

Thanks a lot. Wish you continued this Excel VBA.

eenab
Автор

actually, the timer is still running, when you click the "off". this design model is not correct, because when you click the "On" again, it shows the same times running in the background.

SuperHanme
Автор

Thanks a lot. Very effective and simple.

vksvishwa