+ Reply to Thread
Results 1 to 5 of 5

format userform text box

  1. #1
    Forum Contributor
    Join Date
    05-14-2006
    Posts
    104

    format userform text box

    how can you format a userform textbox to display time ?

    i have set the string as time format ????

    how do i do this ?

  2. #2
    Bob Phillips
    Guest

    Re: format userform text box

    what string?

    just use

    Format(TextBox1.Text,"hh:mm:ss")

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Zygan" <[email protected]> wrote in
    message news:[email protected]...
    >
    > how can you format a userform textbox to display time ?
    >
    > i have set the string as time format ????
    >
    > how do i do this ?
    >
    >
    > --
    > Zygan
    > ------------------------------------------------------------------------
    > Zygan's Profile:

    http://www.excelforum.com/member.php...o&userid=34423
    > View this thread: http://www.excelforum.com/showthread...hreadid=560575
    >




  3. #3
    Forum Contributor
    Join Date
    05-14-2006
    Posts
    104

    not understood

    sorry to sound completely newb but hay,

    i have this code (not all of it but to the point)

    "indate" is a textbox in the userform

    Private Sub UserForm_Activate()
    datein = Sheets("sheet1").Range("a2")

    indate.Text = datein

    End Sub


    where do i put your code ????
    if i place it anywhere in this code it errors ????

  4. #4
    Bob Phillips
    Guest

    Re: format userform text box

    Private Sub UserForm_Activate()
    datein = Sheets("sheet1").Range("a2")

    indate.Text = Format(datein,"hh:mm:ss")

    End Sub


    If the cell is already formatted as time, you could use


    Private Sub UserForm_Activate()

    indate.Text = Sheets("sheet1").Range("A2").Text


    End Sub

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Zygan" <[email protected]> wrote in
    message news:[email protected]...
    >
    > sorry to sound completely newb but hay,
    >
    > i have this code (not all of it but to the point)
    >
    > "indate" is a textbox in the userform
    >
    > Private Sub UserForm_Activate()
    > datein = Sheets("sheet1").Range("a2")
    >
    > indate.Text = datein
    >
    > End Sub
    >
    >
    > where do i put your code ????
    > if i place it anywhere in this code it errors ????
    >
    >
    > --
    > Zygan
    > ------------------------------------------------------------------------
    > Zygan's Profile:

    http://www.excelforum.com/member.php...o&userid=34423
    > View this thread: http://www.excelforum.com/showthread...hreadid=560575
    >




  5. #5
    Bob Phillips
    Guest

    Re: format userform text box

    Private Sub UserForm_Activate()
    datein = Sheets("sheet1").Range("a2")

    indate.Text = Format(datein,"hh:mm:ss")

    End Sub


    If the cell is already formatted as time, you could use


    Private Sub UserForm_Activate()

    indate.Text = Sheets("sheet1").Range("A2").Text


    End Sub

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Zygan" <[email protected]> wrote in
    message news:[email protected]...
    >
    > sorry to sound completely newb but hay,
    >
    > i have this code (not all of it but to the point)
    >
    > "indate" is a textbox in the userform
    >
    > Private Sub UserForm_Activate()
    > datein = Sheets("sheet1").Range("a2")
    >
    > indate.Text = datein
    >
    > End Sub
    >
    >
    > where do i put your code ????
    > if i place it anywhere in this code it errors ????
    >
    >
    > --
    > Zygan
    > ------------------------------------------------------------------------
    > Zygan's Profile:

    http://www.excelforum.com/member.php...o&userid=34423
    > View this thread: http://www.excelforum.com/showthread...hreadid=560575
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1