Welcome message change by time of day

  • Thread starter Joe_Hunt via OfficeKB.com
  • Start date
J

Joe_Hunt via OfficeKB.com

I've done this before, and know it's simple, but can't seem to make it work
now. Can somebody tell me how to change a welcome message based on the time
of day using VBA? I appreciate it.
 
R

Rick Rothstein

Something like this maybe...

If Hour(Time) < 12 Then
MsgBox "Good Morning!"
ElseIf Hour(Time) < 18 Then
MsgBox "Good Afternoon!"
Else
MsgBox "Good Evening!"
End If
 
J

Joe_Hunt via OfficeKB.com

Thanks!

Rick said:
Something like this maybe...

If Hour(Time) < 12 Then
MsgBox "Good Morning!"
ElseIf Hour(Time) < 18 Then
MsgBox "Good Afternoon!"
Else
MsgBox "Good Evening!"
End If
 
Top