Unable to load .CSV correctly when using macros

B

BlackJack

Hello everyone,
Is it possible to upload a CSV (comma separated values)
file delimited by semi-colon (;) (each column separated)
when using a macro??
When I load a CSV file containing, by example, aaa;bbb;ccc
all those columns are loaded in the first column (the
delimiter Excel search for is the comma !!)
How can I specify the ; as delimiters ?

When I save an Excel file to CSV format, the ; is
automatically used as delimiter !!!
 
D

Dan E

BlackJack,

You could have mentioned what you've tried just to give us
a little insight... but heregoes

Workbooks.OpenText Filename:=myTextFile, TextQualifier:=xlTextQualifierDoubleQuote, ConsecutiveDelimiter:=False, Semicolon:=True

watch out for wordwrap.

Search "opentext" in the help for more information on this
function...

Dan E
 
D

Dave Peterson

Excel is understands the windows regional settings when you do file|open and
point to the .csv file manually.

But VBA is very USA centric. I find the easiest thing to do is just rename the
*.csv to *.txt and have my macro use the semicolon as the delimiter.
 

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