Hi, Try this code,
Sub datecorrection() On Error Resume Next Dim MyCell As Range For Each MyCell In Selection.Cells If IsDate(MyCell) Then Selection.NumberFormat = "m/d/yyyy" Else MyCell.Value = DateValue(Mid(MyCell, 5, 2) & "/" & Right(MyCell, 2) & "/" & Left(MyCell, 4)) End If Next On Error GoTo 0 End Sub Regards, MARIES. On Sat, Feb 25, 2012 at 1:15 PM, Sam Mathai Chacko <samde...@gmail.com>wrote: > Use this > > =IF(ISNUMBER(DAY(O2)),O2,DATE(LEFT(O2,4),MID(O2,5,2),RIGHT(O2,2))) > > Regards, > > Sam Mathai Chacko > > > On Sat, Feb 25, 2012 at 2:29 PM, Ashish Bhalara <ashishbhalar...@gmail.com > > wrote: > >> Dear expert, >> >> I have a problem about date format. The data is downloaded from fox base >> software of *.dbf file and the date is not in proper format, the example is >> attached herewith. Also the TYPE function not work and some >> error occurred which also mention in attache sheet, so please know me how >> to change the in proper date to proper dare format (dd-mm-yyyy) and also >> explain me the reason of error in TYPE function. >> >> The computer Date setting is DD-MM-YYYY in customize regional Option from >> control panel. >> >> Thanks & regards >> >> Ashish Bhalara >> >> -- >> FORUM RULES (986+ members already BANNED for violation) >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> >> 2) Don't post a question in the thread of another member. >> >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> >> 4) Acknowledge the responses you receive, good or bad. >> >> 5) Cross-promotion of, or links to, forums competitive to this forum in >> signatures are prohibited. >> >> NOTE : Don't ever post personal or confidential data in a workbook. Forum >> owners and members are not responsible for any loss. >> >> >> ------------------------------------------------------------------------------------------------------ >> To post to this group, send email to excel-macros@googlegroups.com >> > > > > -- > Sam Mathai Chacko > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com