Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with text box and time
My procedure records the system time in a worksheet cell (formatted as "time"), and at the same time, writes to a userform textbox the system time.
On userform activation, it will write recorded data from the spreadsheet to the userform. The problem is, the time that was recorded on the userform, now shows as a decimal number, rather than the actual time displayed in the worksheet cell. This is the line that writes to the spreadsheet, which results in <10:37 PM Sheets("writeformdata").Range("B22").Value = Time This line writes to userform upon activation, which results in <0.942615740740741 txtTime = Sheets("WRITEFORMDATA").Range("B22").Value What's going on here? D.S. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with text box and time
Try this format option txtTime = Format(Sheets("WRITEFORMDATA").Range("B22").Value, "HH:m" ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with text box and time
Thanks Kieran,
that got me on the right track. The following code gave me the result I was looking for txtTime = Format(Sheets("WRITEFORMDATA").Range("B22").Value, "HH:MM AMPM") D.S. "Kieran" wrote in message ... Try this format option txtTime = Format(Sheets("WRITEFORMDATA").Range("B22").Value, "HH:m") ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I convert time as text 'mm:ss to time value in Excel | Excel Discussion (Misc queries) | |||
Macro / function text time to 24hr excel time passed midnight fortotaling hr's | Excel Worksheet Functions | |||
Convert Text Time to Excel Time | Excel Discussion (Misc queries) | |||
convert time imported as text to time format for calculations | Excel Worksheet Functions | |||
Convert Text Time to Time | Excel Discussion (Misc queries) |