Excel help - weird one
Author
Discussion

PixelpeepS3

Original Poster:

9,050 posts

173 months

Thursday 29th August 2019
quotequote all
Hi all,

Having an issue with a date field.

To the eye they look fine, it’s only when you try and filter its displaying 2019 as a collapsible tree and then separately a number of 2019 dates – to me this means it’s not seeing them both as 2019 which means there is something in the data that is different for those entries.

If you cut the column, paste into notepad and then back into excel it fixes it, which confirms there is something in the data which notepad strips, to me.

it's not a space, its not an ALT-0010 or paragraph character and using 'clear all formatting and then reformatting as date doesn't fix it either.

any ideas?


louiebaby

11,005 posts

222 months

Thursday 29th August 2019
quotequote all
PixelpeepS3 said:
Hi all,

Having an issue with a date field.

To the eye they look fine, it’s only when you try and filter its displaying 2019 as a collapsible tree and then separately a number of 2019 dates – to me this means it’s not seeing them both as 2019 which means there is something in the data that is different for those entries.

If you cut the column, paste into notepad and then back into excel it fixes it, which confirms there is something in the data which notepad strips, to me.

it's not a space, its not an ALT-0010 or paragraph character and using 'clear all formatting and then reformatting as date doesn't fix it either.

any ideas?
Are you importing it from a CSV file? If so, and with VBA, you might need to force it to know that it's a date in the UK format, not the US format.

It's related to Local:= True or something similar...

PixelpeepS3

Original Poster:

9,050 posts

173 months

Thursday 29th August 2019
quotequote all
louiebaby said:
Are you importing it from a CSV file? If so, and with VBA, you might need to force it to know that it's a date in the UK format, not the US format.

It's related to Local:= True or something similar...
it is coming from a CSV, created in Ireland.

how do i force it to know its a UK date?

nyt

1,940 posts

181 months

Thursday 29th August 2019
quotequote all
PixelpeepS3 said:
it is coming from a CSV, created in Ireland.

how do i force it to know its a UK date?
For Excel 2010, rather than opening your CSV file, create a new workbook, then on the DATA tab, select Get External Data → From Text. This gets to the interface where you can specify how to interpret your text data, including how to handle dates.

Taken from: https://superuser.com/questions/408432/how-to-stop...

hyphen

26,262 posts

121 months

Thursday 29th August 2019
quotequote all
PixelpeepS3 said:
it is coming from a CSV, created in Ireland.

how do i force it to know its a UK date?
If above suggestion doesn't work, try

Highlight the column in Excel, go to Date->Text to Columns->Delimited->uncheck any delimiters selected and hit next->Under the Column Data Format, select Date, then pick DMY-> Finish.


Edited by hyphen on Thursday 29th August 17:14

louiebaby

11,005 posts

222 months

Friday 30th August 2019
quotequote all
PixelpeepS3 said:
louiebaby said:
Are you importing it from a CSV file? If so, and with VBA, you might need to force it to know that it's a date in the UK format, not the US format.

It's related to Local:= True or something similar...
it is coming from a CSV, created in Ireland.

how do i force it to know its a UK date?
Providing you have your location correct, then this seems to explain it:

https://a4accounting.com.au/vba-to-open-csv-and-av...