PDA

View Full Version : Excel Date formatting issue



jackCell
01-08-2018, 02:51 AM
Hi all,

I am rather new to VBA. In my excel file, the date value is 1/5/2018 7:18:32 AM. However, as seen from the image, the AM/PM sign is missing. I need to copy the values over using VBA, but the result is the same, it still shows without AM/PM. I need it to be in this exact format. How can I achieve this?

21317

Cheers,
Jack

p45cal
01-08-2018, 04:23 AM
something like:
Selection.NumberFormat = "d/m/yyyy h:mm:ss AM/PM"
or
Selection.NumberFormat = "m/d/yyyy h:mm:ss AM/PM"
(I can't tell from your example whether the format is day/month year of month/day/year).