Option Explicit
Sub Date Format()
' akinrotimi, 13/08/2011
http://www.mrexcel.com/forum/newreply.php?do=newreply&noquote=1&p=2826485
Application.ScreenUpdating = False
Range("k2").Select
ActiveCell.FormulaR1C1 = _
"=MID(RC[-1],5,2)&""/""&LEFT(RC[-1],2)&""/""&RIGHT(RC[-1],4)"
Range("k2").Select
ActiveCell.FormulaR1C1 = _
"=MID(RC[-1],5,2)&""/""&RIGHT(RC[-1],4)&""/""&LEFT(RC[-1],4)"
Range("k2").Select
ActiveCell.FormulaR1C1 = _
"=MID(RC[-1],5,2)&""/""&RIGHT(RC[-1],2)&""/""&LEFT(RC[-1],4)"
Range("k2").Select
Selection.AutoFill Destination:=Range("k2:k1000")
Range("k2:k1000").Select
Columns("B:B").EntireColumn.AutoFit
Application.CutCopyMode = False
Range("l2").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""dd/mm/yyyy"")"
Range("l2").Select
Selection.AutoFill Destination:=Range("l2:l1000")
Range("l2:l1000").Select
Selection.Copy
Range("m2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("m2:m1000").Select
Selection.NumberFormat = "dd/mm/yyyy"
Selection.TextToColumns Destination:=Range("m2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 3), TrailingMinusNumbers:=True
Range("n2").Select
Range("k1:l1000").Select
ActiveCell.FormulaR1C1 = "DATE"
Range("M2").Select
Selection.TextToColumns Destination:=Range("M2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 3), TrailingMinusNumbers:=True
Columns("M:M").Select
Selection.TextToColumns Destination:=Range("M1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 3), TrailingMinusNumbers:=True
Columns("M:M").Select
Selection.NumberFormat = "mm/dd/yyyy"
Selection.Copy
Range("N1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.NumberFormat = "m/d/yyyy"
Range("O2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=RC[-3],RC[-2],RC[-1])"
Range("O2").Select
Selection.NumberFormat = "mm/dd/yyyy"
Selection.AutoFill Destination:=Range("O2:O1000")
Range("O2:O1000").Select
Range("O2").Select
ActiveCell.FormulaR1C1 = "=IF(LEFT(RC[-3],2)=LEFT(RC[-2],2),RC[-2],RC[-1])"
Range("O2").Select
Selection.AutoFill Destination:=Range("O2:O1000")
Range("O2:O1000").Select
Range("P2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-4]"
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P1000")
Range("P2:P1000").Select
Range("P2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-4]"
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P1000")
Range("P2:P1000").Select
Columns("K:M").Select
Columns("O:P").Select
Range("P1").Activate
Selection.ClearContents
Range("O2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]=RC[-1]"
Range("O2").Select
Selection.AutoFill Destination:=Range("O2:O1000")
Range("O2:O1000").Select
Range("K1").Select
Columns("j:j").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Columns("k:k").EntireColumn.AutoFit
Range("j1").Select
Columns("K:L").Select
Range("K1").Select
Selection.Cut Destination:=Range("M1")
Columns("K:L").Select
Selection.Delete Shift:=xlToLeft
Columns("L:N").Select
Selection.Delete Shift:=xlToLeft
Range("K1").Select
Application.ScreenUpdating = True
end sub