ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 886
- Office Version
- 365
- 2019
- Platform
- Windows
I have the below code that changes the range of cells. The cell contains a date in general format YYYYMMDD. And needs to end up in date format with MM/DD/YYYY. Is there a cleaner quicker way to do the below? I am just trying to reduce the line of code in my existing sub. Thanks in advance
VBA Code:
'Start Date
wsDSTN.Range("K2").Resize(rws).TextToColumns Destination:=Range("K2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 5), TrailingMinusNumbers:=True
'End Date
wsDSTN.Range("L2").Resize(rws).TextToColumns Destination:=Range("L2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 5), TrailingMinusNumbers:=True
'Due Date
wsDSTN.Range("M2").Resize(rws).TextToColumns Destination:=Range("M2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 5), TrailingMinusNumbers:=True
wsDSTN.Range("K2:M2").Resize(rws).NumberFormat = "mm/dd/yyyy"