Drumin_Phreak
New Member
- Joined
- Oct 10, 2016
- Messages
- 25
Hello,
My goal is to have a condition based on time:
if the system time is 7:00 AM to 3:15 PM "First" would display in the 4th row of column P. However if the time is 3:15:01 pm - 11:15 pm "Second" would be displayed, and "Third" would follow if the time was 11:15:01 pm - 6:59:59.
This task has proven to be a lot more difficult than previously thought. If you would not mid viewing my code and help me figure out why this will not work, i would appreciate it.
Thank you,
Eric
My goal is to have a condition based on time:
if the system time is 7:00 AM to 3:15 PM "First" would display in the 4th row of column P. However if the time is 3:15:01 pm - 11:15 pm "Second" would be displayed, and "Third" would follow if the time was 11:15:01 pm - 6:59:59.
This task has proven to be a lot more difficult than previously thought. If you would not mid viewing my code and help me figure out why this will not work, i would appreciate it.
Code:
If Time >= #7:00:00 AM# And Time <= #3:15:00 PM# Then
Range("P4").Value = "First"
ElseIf Time >= #3:15:01 PM# And Time <= #11:15:00 PM# Then
Range("P4").Value = "Second"
ElseIf Time >= #11:15:01 PM# And Time <= #6:59:00 AM# Then
"
Range("P4").Value = "Third"
End If
Thank you,
Eric