+ Reply to Thread
Results 1 to 2 of 2

Time error in user form

  1. #1
    Registered User
    Join Date
    02-20-2005
    Posts
    53

    Time error in user form

    Hi
    I have a user form with text boxes, one that gives a value of the active cell contents of a time in a diary worksheet. These cells are custom formated has hh:mm

    The user form text box code is:
    Private Sub txttime_Change()
    txttime.Value = Format(txttime.Value, "hh:mm")
    End Sub

    This works well, for all times except 12:00.
    When you activate a cell at 12:00 the text box reads 00:05 yet in all other times its ok?
    Any ideas whats wrong I have tried various forms of formatting.
    Bern

  2. #2
    Registered User
    Join Date
    02-20-2005
    Posts
    53

    Reply

    Hi
    I have managed to work it out myself, so for anybody with similar problem:

    I formated the time cells to text and entered ie 12:00
    and entered a change event in the user form text box:

    Private Sub txttime_Change()
    txttime.Value = Format(ActiveCell.Value, "hh:mm")
    End Sub
    now all the times read as they should.
    cheers
    Bern

+ 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