Hello,

I recorded a macro for formatting text value 31-09-14 as date format using "Text to Column" option. The code is as follows:

Sub Date_Formatting()
'
' Date_Formatting Macro
' To change the text format to date format
'
' Keyboard Shortcut: Ctrl+Shift+J
'
'Dim a As Range

'a = Selection.Range

    Selection.TextToColumns Destination:=Range("A4"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(1, 4), TrailingMinusNumbers:=True
End Sub
I couldnot change the "Destination:=Range("A4")" as it is showing error. I need to change it as whatever cells I select it should take that as Destination and change the format.

Any help appreciated.

Thanks,
aganesan99