View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bearacade[_15_] Bearacade[_15_] is offline
external usenet poster
 
Posts: 1
Default NEED HELP: For this Code


add spaces before the AM and PM

Private Sub UserForm_Activate()

Dim Wish As String
Dim Cur_Time As Date
Dim Cur_User As String

Cur_Time = Time

'Label1.Caption = Cur_Time

If Cur_Time = "12:00:00 AM" And Cur_Time < "12:00:00 PM" Then
Wish = "Good Morning"
ElseIf Cur_Time = "12:00:00 PM" And Cur_Time < "3:00:00 PM" Then
Wish = "Good Afternoon"
ElseIf Cur_Time = "3:00:00 PM" And Cur_Time < "12:00:00 AM" Then
Wish = "Good Evening"
Else: Wish = "NULL"
End If

Label1.Caption = Cur_Time & " - " & Wish


End Sub


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=552740