Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert time as text 'mm:ss to time value in Excel Sholto Excel Discussion (Misc queries) 5 April 1st 09 05:40 AM
Macro / function text time to 24hr excel time passed midnight fortotaling hr's Russmaz Excel Worksheet Functions 2 March 6th 09 04:58 AM
Convert Text Time to Excel Time [email protected] Excel Discussion (Misc queries) 5 January 29th 07 04:43 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
Convert Text Time to Time Jan Excel Discussion (Misc queries) 1 March 7th 05 06:05 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"