ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing time format (https://www.excelbanter.com/excel-programming/298593-changing-time-format.html)

JT[_2_]

changing time format
 
I have a spreadsheet where the time is displayed as 0405P
or 1115A.

What code can I use to change the time to 04:05:00 PM or
11:15:00 AM?

Thanks for the help.

Frank Kabel

changing time format
 
Hi
in a separate cell enter the formula
=TIMEVALUE(LEFT(A1,2)&":"&MID(A1,3,2) & " " & RIGHT(A1,1) & "M")

--
Regards
Frank Kabel
Frankfurt, Germany


JT wrote:
I have a spreadsheet where the time is displayed as 0405P
or 1115A.

What code can I use to change the time to 04:05:00 PM or
11:15:00 AM?

Thanks for the help.


Trevor Shuttleworth

changing time format
 
For that display, you must have a custom format of "hhmmA/P"

Just go to Format | Cells... | Number | Category: Custom | Type: "hh:mm:ss
AM/PM"

Regards

Trevor


"JT" wrote in message
...
I have a spreadsheet where the time is displayed as 0405P
or 1115A.

What code can I use to change the time to 04:05:00 PM or
11:15:00 AM?

Thanks for the help.





All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com