Trebor8484
Board Regular
- Joined
- Oct 27, 2018
- Messages
- 69
- Office Version
- 2013
- Platform
- Windows
Hi all,
I have a column containing dates, some of which are text formatted dates and Excel prompts me that "This cell represents a date string represented with only 2 digits for the year". There are other cells within the column that are formatted as number. What I am trying to do is apply text to columns on the column which then correctly coverts the text dates to correct dates. For the cells that are already in number format though the dates will sometimes convert from UK to American format, so 03/08/2019 is is displayed as 08/03/2019. It seems hit and miss though, sometimes it converts it, sometimes it displays it correctly.
What I want to do is use VBA to convert the full column as I have some other code that merges multiple workbooks into one and some of these have dates provided in different formats, i.e. some as text and some as correct dates. Can anyone suggest a way to do this successfully were correct dates are ignored and text formatted dates are amended> The final output should have a fully formatted column of dates in UK format.
I have always used the below code and have never noticed this problem before.
I have a column containing dates, some of which are text formatted dates and Excel prompts me that "This cell represents a date string represented with only 2 digits for the year". There are other cells within the column that are formatted as number. What I am trying to do is apply text to columns on the column which then correctly coverts the text dates to correct dates. For the cells that are already in number format though the dates will sometimes convert from UK to American format, so 03/08/2019 is is displayed as 08/03/2019. It seems hit and miss though, sometimes it converts it, sometimes it displays it correctly.
What I want to do is use VBA to convert the full column as I have some other code that merges multiple workbooks into one and some of these have dates provided in different formats, i.e. some as text and some as correct dates. Can anyone suggest a way to do this successfully were correct dates are ignored and text formatted dates are amended> The final output should have a fully formatted column of dates in UK format.
I have always used the below code and have never noticed this problem before.
VBA Code:
DstSheet.[C:C].TextToColumns , xlDelimited, , False, False, False, False, False, False