This VBScript example creates a desktop exercise reminder that sleeps in the background and reminds you to take a break every 45 minutes. If you’re an office worker, this example is sure to help you battle the sedentary lifestyle.

I encourage you to visit the exercise reminder tutorial to learn how to customize the script.

dTimer=InputBox("Enter timer interval in minutes","Set Timer") 'minutes

do until IsNumeric(dTimer)=True
  dTimer=InputBox("Invalid Entry" & vbnewline & vbnewline & _ 
         "Enter timer interval in minutes","Set Timer") 'minutes
loop

if dTimer<>"" then
do
  WScript.Sleep dTimer*60*1000 'convert from minutes to milliseconds
  t=MsgBox("Take a Walk." & vbnewline & vbnewline & "Restart Timer?", _
    vbYesNo, "It's been " & dTimer &" minute(s)")
  if t=6 then 'if yes
       'continue loop
  else 'exit loop
       exit do
  end if
loop
end if

That’s all for this tutorial. When you’re ready to take your VBA to the next level, subscribe using the form below.