Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
option buttons run Click code when value is changed via VBA code | Excel Programming |