Jesse shares his story

Jesse sent me an e-mail this morning. Check it out:

I had to get up at around 5:00 this morning due to car swapping logistics. I didn’t get to bed until after midnight last night, so needless to say, I’m tired as heck. Got to work at about 7:45, and the rest of my team doesn’t usually show up until around 9:00, so what was I to do? I decided to take a nap at my desk. I left my cell phone in the car, and I didn’t want to go get it just to be able to set an alarm, but I also didn’t want to be found passed out. So then what did I do?

I wrote this (even has a Snooze!):

Sub AlarmClock()

Dim hourOffset, minOffset, secOffset, snoozeTime As Integer

hourOffset = 0
minOffset = 45
secOffset = 0
snoozeTime = 5

newHour = Hour(Now()) + hourOffset
newMinute = Minute(Now()) + minOffset
newSecond = Second(Now()) + secOffset
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

For i = 1 To 5
Application.Wait (Now + TimeValue(“0:00:02”))
Next i

snoozeOn = MsgBox(“Snooze?”, 4)

If snoozeOn = 6 Then
hourOffset = 0
minOffset = snoozeTime
secOffset = 0
End If
Loop Until snoozeOn = 7

End Sub

3 thoughts on “Jesse shares his story

Leave a Reply

Your email address will not be published. Required fields are marked *