• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change in Time Format

ThrottleWorks

Excel Ninja
I have a reporting macro, the macro populates the details on the basis of product types.

Customer places an order & it gets time stamped.

We receive all the details in .csv format,

we paste it in the excel for our processing.


A particular time stamp is like “Mon Dec 12 11:22:25 EST 2011”.


I have a problem, I need to show this time stamp as “11:22:25 P.M”.

Is it possible with the help of macro, I do not want to show year, month in the stamp just the place time with A.M. or P.M. details.


I tried combinations of, convert to text, =(right) & = (left), but could not get the final result.


Can anyone help me in this please.
 
[pre]
Code:
With ActiveCell

.Value = TimeSerial(Mid$(.Value, 12, 2), Mid$(.Value, 15, 2), Mid$(.Value, 18, 2))
.NumberFormat = "hh:mm:ss"
End With
[/pre]
 
Back
Top