Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
What am I doing wrong? The time now is 3:24 AM and when I run this code, the greeting should be equal to "Good morning" but it's not. Instead, it's equal to "Good evening". Thank you.
VBA Code:
Sub greetings()
Select Case Time()
Case "12:00:00 AM" To "12:00:00 PM"
Greeting = "Good morning, "
Case "12:00:01 PM" To "18:00:00 PM"
Greeting = "Good afternoon, "
Case Else
Greeting = "Good evening, "
End Select
End Sub