MichielVanGend
New Member
- Joined
- Apr 29, 2019
- Messages
- 1
Hi,
I want to splits cells (text to columns) with a VBA Macro.
I'm using the following code:
Columns("A:A").Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False
This works but with one slight problem:
9999;1-2-2019;test (<- this date is januari second)
gets split as:
9999|2-1-2019|test
If I perform the same action manually it gets splits as:
9999|1-2-2019|test
The last option is the one that I need.
So manually it uses European dates, with VBA It uses American dates.
Normally I don’t know how many date fields will be in my data or on what position they occur.
Is there a way to get the dates in the right format?
I want to splits cells (text to columns) with a VBA Macro.
I'm using the following code:
Columns("A:A").Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False
This works but with one slight problem:
9999;1-2-2019;test (<- this date is januari second)
gets split as:
9999|2-1-2019|test
If I perform the same action manually it gets splits as:
9999|1-2-2019|test
The last option is the one that I need.
So manually it uses European dates, with VBA It uses American dates.
Normally I don’t know how many date fields will be in my data or on what position they occur.
Is there a way to get the dates in the right format?