Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display date on useform... (excel97)

    Hello again..

    I have succeed doing this..the problem is the date format and the time format..but problem occured again...

    1. when i use "dd mmm yyyy format" , it still display as "m d yy" ( i want it to look like this 02 July 2001 but it show 7/2/01 )

    2. how can i display time without date i.e
    i want it show like this : 4:54:45 PM and not like : 8/2/01 4:54:45 PM

    3. is it possible to add text after the date..i.e..
    " 02 july 2001 4:54:45 PM - NiuB like you "

    the conclusion is..how can i display all this thing to be display as the format that i like.. i.e :
    " 02 July 2001 4:54:45 PM - NiuB like you "

    I meant using single text box only instead like what am i doing right now using two text boxes and still can't get the result

    thanks a zillion

    here is my code..

    Private Sub UserForm_activate()

    TextBox1.Value = "The time is now : " & Now
    TextBox2.Value = "Todays date is : " & Date

    TextBox1.Value = Format(TextBox1.Value, "hh:mm AM/PM ")
    TextBox2.Value = Format(TextBox2.Value, "dd mmmm yyyy ")


    End Sub

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Display date on useform... (excel97)

    NiuB

    Try just the followint 2 lines !! <pre>TextBox1.Value = Format(Now(), "hh:mm AM/PM ")
    TextBox2.Value = Format(Now(), "dd mmmm yyyy ")</pre>

    The following will give the message you want (you may not need a textbox) :-
    <pre>Sub Greeting()
    Dim strMessage As String
    strMessage = Format(Now(), "d MMMM yyyy, hh:mm AM/PM") & " NiuB Like You"
    MsgBox strMessage
    End Sub</pre>


    Andrew C

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display date on useform... (excel97)

    As I told you before Andrew..you such a doll..
    It works like magic..lol..many thanks and thanks again Andrew..regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •