Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a create, edit, delete program I've done in excel and I need to
pass a start time and end time value back and forth from cells to my userform. I've tried using military format HHMM and 00\:00. It works fine passing the time value from the userform to the cell, but not the other way!! Here's my variable (dim as date): BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM") The cell this value is entered in is in custom HHMM format. When I pass it back to the program it reads (for example) 1200 as 0000 or 12:00:00 AM. HELP!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try changing .Text to .Value. The format function takes a date (or number)
and converts it to a text string with a specific format applied. What you are doing is passing in a string which format can't do too much with... -- HTH... Jim Thomlinson "sbowman" wrote: I have a create, edit, delete program I've done in excel and I need to pass a start time and end time value back and forth from cells to my userform. I've tried using military format HHMM and 00\:00. It works fine passing the time value from the userform to the cell, but not the other way!! Here's my variable (dim as date): BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM") The cell this value is entered in is in custom HHMM format. When I pass it back to the program it reads (for example) 1200 as 0000 or 12:00:00 AM. HELP!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
nevermind I fixed it by formatting the cells as text instead of
general. I'm not doing any time calculations, so it's fine to have it as text instead of a date. Thanks anyway... Shelley Jim Thomlinson wrote: Try changing .Text to .Value. The format function takes a date (or number) and converts it to a text string with a specific format applied. What you are doing is passing in a string which format can't do too much with... -- HTH... Jim Thomlinson "sbowman" wrote: I have a create, edit, delete program I've done in excel and I need to pass a start time and end time value back and forth from cells to my userform. I've tried using military format HHMM and 00\:00. It works fine passing the time value from the userform to the cell, but not the other way!! Here's my variable (dim as date): BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM") The cell this value is entered in is in custom HHMM format. When I pass it back to the program it reads (for example) 1200 as 0000 or 12:00:00 AM. HELP!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting Standard Time to Military Time in Excel | Excel Discussion (Misc queries) | |||
Converting standard time to military time | Excel Worksheet Functions | |||
formula for converting military time to standard time, etc | Excel Discussion (Misc queries) | |||
Converting Standard Time into Military Time | Excel Discussion (Misc queries) | |||
Show timesheet time in and out in regular time versus military tim | Excel Worksheet Functions |