Try this:
Code:currentHour = DatePart("h", Time) '*** 5:00 PM is hour 17 if currentHour > 17 then Call YourMacro End If
I realize this is a very old thread but I'm hoping someone sees it and can help. Trying to use a similar code to this but I need the code to pull during a time range--from 5pm until 8AM. I have tried "If ReceivedHour < 08 or > 17 Then" and I keep getting an error. the code works fine with only one time variable. Thanks.
If ReceivedHour < 8 Or ReceivedHour > 16 Then