Hermanator
Technical User
Hello people,
I'm busy programming a simple macro. As part of this macro, a .CSV needs to be imported. The .CSV is formatted as follows:
0.500; 100
1.000; 200
1.500; 500
So a semicolon seperates different columns, and a line-end goes to the next row. I can open the .CSV files without any problem. When I double click the file, it is opened correctly in Excel, and also when I open the file using File, Open.
However, when I try to import a .CSV file from a macro, it places all the values of one row in one cell. So the contents of the cell is then: "0.500; 100". Delimiter settings are correct!
This leads to the following strange situation:
- I Select "Record New Macro"
- Using File, Open, I open the .CSV file. (It is opened correctly)
- I Select "Stop recording Macro"
- I close the .CSV file
- I run the macro that I have just recorded, but this time the file has been incorrectly imported!
I can check the macro, and all delimiter options are correct. It also doesn't matter wether I'm using
or
In both cases I select the semicolon ";" as the delimiter. But in both cases, Excel places all the values in the first cell.
Normally I can find a solution to any problem that I encounter, however, this time I have absolutely no clue!
I'm busy programming a simple macro. As part of this macro, a .CSV needs to be imported. The .CSV is formatted as follows:
0.500; 100
1.000; 200
1.500; 500
So a semicolon seperates different columns, and a line-end goes to the next row. I can open the .CSV files without any problem. When I double click the file, it is opened correctly in Excel, and also when I open the file using File, Open.
However, when I try to import a .CSV file from a macro, it places all the values of one row in one cell. So the contents of the cell is then: "0.500; 100". Delimiter settings are correct!
This leads to the following strange situation:
- I Select "Record New Macro"
- Using File, Open, I open the .CSV file. (It is opened correctly)
- I Select "Stop recording Macro"
- I close the .CSV file
- I run the macro that I have just recorded, but this time the file has been incorrectly imported!
I can check the macro, and all delimiter options are correct. It also doesn't matter wether I'm using
Code:
Workbooks.OpenText
or
Code:
Workbooks.Open
In both cases I select the semicolon ";" as the delimiter. But in both cases, Excel places all the values in the first cell.
Normally I can find a solution to any problem that I encounter, however, this time I have absolutely no clue!