Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Date Manipulation
Resolved · High Priority · Version 2003
Michael has attended:
Excel VBA Advanced course
Is there a ready macro to check the format of the date, and if in US format, convert into British date format? Thanks
Hi Michael
Thanks for the question. The following function chops up the date into day, month and year and then arranges it into UK format
Public Function DateConverter(USDate As String) As Date
Dim strMonth As String
Dim strDay As String
Dim strYear As String
Dim strDate As String
strDay = DatePart("d", USDate)
strMonth = DatePart("m", USDate)
strYear = DatePart("yyyy", USDate)
strDate = strDay & "/" & strMonth & "/" & strYear
DateConverter = CDate(strDate)
End Function
Thu 30 Jun 2011: Automatically marked as resolved.
|
Excel tip:Create Charts with One keystrokeCreate a graph with one click |
We'll call during UK business hours
Server loaded in 0.11 secs.