VBA Half-Second Timer Help
Moderator: Moderators
VBA Half-Second Timer Help
Does anyone know how to make a timer for a half-second? I am trying to make a cell change colors twice a second. I have the basic clock code using the time format feature but can not get it to count a half-second. I did a little research and found something about using 500 as a time interval but can not find any more info on it otherwise. Any help will be appreciated. Thanks
-
jeffslot
- Portablizer Extraordinaire
- Posts: 853
- Joined: Wed Jun 01, 2005 6:26 am
- Location: PA
- Contact:
Hi,
I think you might want to set the timer's interval property to 500 (because 1000 milliseconds = 1 second)
Then in the timer's tick event you will want to put your code to change colors in the cell.
I think that trick is to enable (timer1.enabled = true )the timer right when you want it to start counting. I hope this helps this is how I do it using vb.net.
Jeff
I think you might want to set the timer's interval property to 500 (because 1000 milliseconds = 1 second)
Then in the timer's tick event you will want to put your code to change colors in the cell.
I think that trick is to enable (timer1.enabled = true )the timer right when you want it to start counting. I hope this helps this is how I do it using vb.net.
Jeff
Does anyone know how to make a timer for a half-second? I am trying to make a cell change colors twice a second. I have the basic clock code using the time format feature but can not get it to count a half-second. I did a little research and found something about using 500 as a time interval but can not find any more info on it otherwise. Any help will be appreciated. Thanks
-
jeffslot
- Portablizer Extraordinaire
- Posts: 853
- Joined: Wed Jun 01, 2005 6:26 am
- Location: PA
- Contact:
Yeah, I've noticed that there doesn't seem to be a 'Timer Control' in VBA (although I've read about some 3rd party ones you can download), I haven't really had the time yet to look at this issue. I did come across this article, I hope it is helpfull:
http://www.cpearson.com/excel/OnTime.aspx
http://www.cpearson.com/excel/OnTime.aspx