Attribute VB_Name = "Pomodoro" '-------------------------------------------------- '-------------------------------------------------- 'Pomodoro technique timer. Written by Lance in VBA 'use to increase your productivity. '-------------------------------------------------- '-------------------------------------------------- ' ' ' Directions for use '__________________________________________________ '1. Create a list of items you wish to complete '2. Run the "start" subroutine '3. Begin working on the first item and work on ' that item exclusively until the timer is up '4. When the timer finishes, take a break as ' directed. Move on to another item on your ' list. If you have not finished the work on ' your current item, come back to it during ' another pomodoro. '5. When your list is complete, run the "Finish" ' subroutine. '6. Enjoy having completed your To Do list! '__________________________________________________ Public iSets As Integer Public iPomodoros As Integer Public nextTime Sub start() 'reset our variables iPomodoros = 0 iSets = 0 'prepare the user ans = MsgBox("Are you ready? Make sure you have your list of items!", vbYesNo + vbQuestion, _ "Ready?") 'if yes is clicked then If ans = vbYes Then 'prepare, OK will start the timer MsgBox "Your time will begin when you click OK!" 'set our next time value nextTime = Now() + TimeValue("00:25:00") 'schedule our next pomodoro Application.OnTime nextTime, "incrementPoms" Else 'when the user clicks no MsgBox "Okay, Come back when you are ready to begin" End If End Sub Sub incrementSet() 'reset the pomodoros iPomodoros = 0 'increment our sets iSets = iSets + 1 'take our 15min. break MsgBox "Take a 15-30min. Break. Then switch to a new task and click OK to start the timer again" End Sub Sub incrementPoms() 'increase the count iPomodoros = iPomodoros + 1 'if we have a new set then make it If iPomodoros = 4 Then incrementSet Else 'let us know we need a small break MsgBox "Take a short break, 3-5minutes." & _ "Then switch to a new task and click OK to start the timer" End If 'set our next time variable nextTime = Now() + TimeValue("00:25:00") 'schedule the next pomodoro Application.OnTime nextTime, "incrementPoms" End Sub Sub Finish() 'Let's see how well we did! MsgBox "Congratulations! You completed " & iSets & " sets plus " & iPomodoros & " Pomodoros" 'cancel the next pomodoro Application.OnTime nextTime, "incrementPoms", schedule:=False End Sub