How do I format a date and time in Excel VBA ?
Posted on 2013-12-18
I have an Excel worksheet with date/time combinations held as 3 separate cells in the following formats:
Cell 1 (Date): dd-mm-yyyy (eg 24-Dec-2013)
Cell 2 (Time): #n.nn (eg 2.30)
Cell 3 (AM/PM): xx (eg AM)
Using the data in these 3 cells I want to create a VBA function which will output a string in the following format:
[dddd] [dd] [mmmm] [yyyy] [hh.mm][am/pm]
For example, Tuesday 24 December 2013 2.30pm
Any ideas ?