Consulting

Results 1 to 4 of 4

Thread: adding time 15min in a textbox

  1. #1

    adding time 15min in a textbox

    When I click the enter button on a userform, I would like to add 15 min to the time in a text box that I use in userform.

    example:

    if I have 12:15 in the textbox and I click enter button on the userform to enter the time at a destination cell, it should add 12:30 to the destination cell.

    thank you in advance

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Worksheets("Sheet1").Range("A2").Value = TimeValue(TextBox1.Value) + TimeSerial(0,15,0)
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Sorry for the confusion, but I should have been more clearer. I would like to add 15 mins to the time in the textbox and the new time will be entered to the destination cell.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Yeah, that is what I gave you.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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