Help with creating a time sampling loop

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

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

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