Importing colon-separated fields

midsession

Board Regular
Joined
Oct 12, 2006
Messages
70
Hello MrExcel

I am importing tables via WebQuery where some columns contain data separated by a colon. I can split the data using TextToColumns, but I can't get the worksheet to display the data 'as is' -it insists on treating it as a time. For instance ...
If I import 0:3 worksheet displays 12 and 3
If I import 13:3 worksheet displays 1 and 3

Worse than that, when I record a macro, the split and copy seems to work fine. When I rerun the macro it reverts to reading 17:06 as 5 and 06!

Can anyone help?
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

midsession

Board Regular
Joined
Oct 12, 2006
Messages
70
Makes no difference whether NumberFormat is General or @ before TextToColumns

On TextToColumns, FieldInfo is currently Array(Array(1, 2), Array(2, 2), Array(3, 9)). This setup is due to the fact that Excel reads the cell format as custom hh:mm, with the consequence that when you run TextToColumns manually it thinks it has three fields to split (17:06:00).
Again, no diff if setup is Array(Array(1, 1), Array(2, 1), Array(3, 9)).
 

midsession

Board Regular
Joined
Oct 12, 2006
Messages
70
Are people not able to replicate this problem? Maybe it's a date-reading system setting rather than the code ...
 

Watch MrExcel Video

Forum statistics

Threads
1,114,674
Messages
5,549,358
Members
410,910
Latest member
DessertDiva
Top