+ Reply to Thread
Results 1 to 3 of 3

text box format

  1. #1
    Registered User
    Join Date
    04-07-2005
    Posts
    2

    text box format

    Help
    I have a userform with text boxes in and I use the form to call up information held in the spreadsheet it displays the time bxes as numers not time
    eg should show 7:00 but shows 0.21966 can anyone tell me how to correct his

    thanks

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Use the Format function to coerce the data into the format you want. Try this (replace my worksheet/range reference with your own:
    Please Login or Register  to view this content.
    Hope this Helps,
    theDude

  3. #3
    Registered User
    Join Date
    04-07-2005
    Posts
    2
    Thanks I must be doing someting wrong
    here is my code combox4 is the time box


    Private Sub CommandButton1_Click()
    Dim LastRow As Object

    Set LastRow = Sheet1.Range("a65536").End(xlUp)

    LastRow.Offset(1, 0).Value = TextBox1.Text
    Rem LastRow.Offset(1, 1).Value = TextBox2.Text
    LastRow.Offset(1, 2).Value = TextBox3.Text
    Rem LastRow.Offset(1, 3).Value = TextBox4.Text
    LastRow.Offset(1, 1).Value = ComboBox1.Text
    LastRow.Offset(1, 3).Value = ComboBox2.Text
    LastRow.Offset(1, 6).Value = ComboBox3.Text
    LastRow.Offset(1, 9).Value = ComboBox4.Text
    LastRow.Offset(1, 11).Value = ComboBox5.Text
    LastRow.Offset(1, 14).Value = ComboBox6.Text
    LastRow.Offset(1, 16).Value = ComboBox7.Text
    LastRow.Offset(1, 19).Value = ComboBox12.Text
    LastRow.Offset(1, 21).Value = ComboBox8.Text
    LastRow.Offset(1, 24).Value = ComboBox13.Text
    LastRow.Offset(1, 26).Value = ComboBox9.Text
    LastRow.Offset(1, 29).Value = ComboBox14.Text
    LastRow.Offset(1, 31).Value = ComboBox10.Text
    LastRow.Offset(1, 34).Value = ComboBox15.Text
    LastRow.Offset(1, 36).Value = ComboBox11.Text
    LastRow.Offset(1, 39).Value = ComboBox16.Text
    MsgBox "One record written to File"

    response = MsgBox("Do you want to enter another record?", _
    vbYesNo)

    Thanks

+ 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