date manipulation
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Date Manipulation

Date Manipulation

resolvedResolved · High Priority · Version 2003

replyReply Thu 23 Jun 2011, 16:10Delegate Michael said...

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

For upcoming training course dates see: Pricing & availability

replyReply Fri 24 Jun 2011, 13:58Trainer Stephen said...

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

Thu 30 Jun 2011: Automatically marked as resolved.

 

Please browse our web site to find out more about
exce+training and other Microsoft training courses.

Excel tip:

Activating the formula bar with the keyboard in Excel 2010

The formula bar in Excel 2010 contains a number of different formulas. However, it is time consuming to open the formula bar every time and insert the formula using the mouse. Instead, you can activate the formula bar with the keyboard. Simply press the F2 button on the keyboard then the information in the cell will expand allowing you to edit the information in the cell.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard