ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with creating a time sampling loop (https://www.excelbanter.com/excel-programming/419629-help-creating-time-sampling-loop.html)

Ben

Help with creating a time sampling loop
 
I am conducting observations where every 30 seconds I have to record what a
subject is doing. I have very little experience with VBA and I was wondering
if there was a way to create something where every 30 seconds either a cell
lights up or something pops up to alert me to look at what a subject is
doing. Any help would be appreciated! Thanks!

JLGWhiz

Help with creating a time sampling loop
 
I put a counter on this so it could be limited to a specific number of loops
rather than run continuously until the workbook is closed. Try it out. If
it works, you can modify the counter limits or remove the counter altogether.
You can also replace the Beep line with a message box statement.

Sub wakeUp()
counter = 0
Do
s = Timer + 30
Do While Timer < s
DoEvents
If Timer = s Then Beep
Loop
counter = counter + 1
Loop Until counter = 10
End Sub






"Ben" wrote:

I am conducting observations where every 30 seconds I have to record what a
subject is doing. I have very little experience with VBA and I was wondering
if there was a way to create something where every 30 seconds either a cell
lights up or something pops up to alert me to look at what a subject is
doing. Any help would be appreciated! Thanks!


John Bundy

Help with creating a time sampling loop
 
Courtesy of Harold in an earlier post
http://www.mvps.org/dmcritchie/excel/datetime.htm
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Ben" wrote:

I am conducting observations where every 30 seconds I have to record what a
subject is doing. I have very little experience with VBA and I was wondering
if there was a way to create something where every 30 seconds either a cell
lights up or something pops up to alert me to look at what a subject is
doing. Any help would be appreciated! Thanks!


dbKemp

Help with creating a time sampling loop
 
On Nov 6, 11:21 am, Ben wrote:
I am conducting observations where every 30 seconds I have to record what a
subject is doing. I have very little experience with VBA and I was wondering
if there was a way to create something where every 30 seconds either a cell
lights up or something pops up to alert me to look at what a subject is
doing. Any help would be appreciated! Thanks!


look at help for Timer


All times are GMT +1. The time now is 05:31 PM.

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