Exporting to csv using macro

D

Dutchessa

Hello,

I've encountered a problem in Excel that I can't seem to solve.

I have about 20 files in xls format, in which I want to change one column
and then export to csv files

When I do this manually (open the file, change a column and export to csv)
they are saved in SEMICOLON delimited csv files.

I made a macro to open all those files, change the proper column and then
export it to csv. When I do it like this, they are saved as COMMA delimited
csv files. The problem is, that I need the semicolon delimited files in
order to be able to import them into other software.

It's like the macro changes the format automatically.

Anybody know what's going on here? I hope I am clear enough...
 
D

Dave Peterson

Excel itself will listen to your windows regional settings.

But VBA is more USA centric--and stubborn. It won't even look there.

You could write your own code that used the delimiter of your choice.

I'd try to steal as much as possible from one of these samples:

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

Earl Kiosterud's:
http://www.tushar-mehta.com/
Look for Text Write in the left hand frame.

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

(You may want to try Earl's. It may be sufficient as is.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top