Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to convert MM/DD/YYYY H:mm:ss AM/PM to military time. I copied
the macro provided by Bernie Deitrick to Soccer Star, and got the same error message with ..Value = TimeValue(TimeStr). I've named the start time TimeStr, but don't know what to do next. TIA, Carole O |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
You can just format the cells containing the military times: -select the cells (or entire column) -menu Format Cells, tab Number: -choose Time as category - choose a non-AM/PM type, eg: 13:30:55 Regards, Sébatien "Carole O" wrote: I am trying to convert MM/DD/YYYY H:mm:ss AM/PM to military time. I copied the macro provided by Bernie Deitrick to Soccer Star, and got the same error message with ..Value = TimeValue(TimeStr). I've named the start time TimeStr, but don't know what to do next. TIA, Carole O |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
to elaborate. There is no military time or AM/PM time. There is only time.
Time is stored as fraction of a 24 hour day, so if a .5 is stored, it is 1/2 a day or 12:00 PM. You can then format the cell to display in any supported manner. any whole numbers in the value indicate the number of days from a base date. The default is midnight just before 1/1/1900 so 1.5 would be 1/1/1900 12:00:00 AM/PM 38221.25 in a cell formatted as a date/time would be Aug 12, 2004 8:00:00 AM. you can format it to display anyway you want, including military time. -- Regards, Tom Ogilvy "sebastienm" wrote in message ... Hi, You can just format the cells containing the military times: -select the cells (or entire column) -menu Format Cells, tab Number: -choose Time as category - choose a non-AM/PM type, eg: 13:30:55 Regards, Sébatien "Carole O" wrote: I am trying to convert MM/DD/YYYY H:mm:ss AM/PM to military time. I copied the macro provided by Bernie Deitrick to Soccer Star, and got the same error message with ..Value = TimeValue(TimeStr). I've named the start time TimeStr, but don't know what to do next. TIA, Carole O |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please, disregard my previous post.
-What is your input: you have a date data type variable or a date in a string ? if string, in which format? -What do you want as output: a string (containing a date) formatted as MM/DD/YYYY H:mm:ss AM/PM ? I suppose you can use the Format function. Example: Dim d as date d=Now() msgbox "US: " & format(d, "mm/dd/yyy h:mm:ss AM/PM") msgbox "Military: " & format(d, "mm/dd/yyy h:mm:ss") Regards, Sebastien "Carole O" wrote: I am trying to convert MM/DD/YYYY H:mm:ss AM/PM to military time. I copied the macro provided by Bernie Deitrick to Soccer Star, and got the same error message with ..Value = TimeValue(TimeStr). I've named the start time TimeStr, but don't know what to do next. TIA, Carole O |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there an XLS function to convert std time to Military time? | Excel Worksheet Functions | |||
convert military time to regular hours | Excel Worksheet Functions | |||
Convert to Military time? | Excel Discussion (Misc queries) | |||
Convert data into standard military time format | Excel Discussion (Misc queries) | |||
How do I convert Military Time to minutes? | Excel Worksheet Functions |