Michael has attended:
Excel VBA Advanced course
Date Manipulation
Is there a ready macro to check the format of the date, and if in US format, convert into British date format? Thanks
RE: Date Manipulation
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
I hope this helps
Stephen