Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a user form that does the following: (1) A textbox records the time when the userform opens (and the employee's use of the form begins); and (2) a different textbox records the time when the employee presses a commandbutton signifying the conclusion of the data entry. (3) In a third text box, I am trying to subtract time #2 from time #1 to calculate the total time spent by the employee on the particular data entry item. The code for entry of time in either textbox is simply: ___________ sub startime() starttime = time Userform1.textbox1.value = starttime end sub ____________ sub endtime() endtime = time userform1.textbox2.value = endtime ' the following code doesn't work userform1.textbox3.value = userform1.textbox2.value - Userform1.textbox1.value end sub ___________ Ideas? Bonus questions: (A) I also want the textboxes to format the time as military time 00:00:00. (B) It would be great if the start-time text box actually looked like a timer and counter the minutes and seconds in real time -- jasonsweeney ------------------------------------------------------------------------ jasonsweeney's Profile: http://www.excelforum.com/member.php...fo&userid=5222 View this thread: http://www.excelforum.com/showthread...hreadid=394457 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding and Subtracting a Time with MilliSeconds | Excel Worksheet Functions | |||
Adding and subtracting time | Excel Worksheet Functions | |||
Adding/Subtracting Time Help... | Excel Worksheet Functions | |||
adding/subtracting time | Excel Worksheet Functions | |||
Macros - Adding & Subtracting Time | Excel Programming |