Save as CSV with semicolon separator Save as CSV with semicolon separator vba vba

Save as CSV with semicolon separator


Which language does your Excel use? If your native language uses ";" as default, you can pass the parameter "local:=True"

ActiveWorkbook.SaveAs Filename:="C:\Temp\Fredi.csv", FileFormat:=xlCSV, CreateBackup:=False, local:=True

If not, your only choice is searching and replacing afterwards...


I had been looking this up to help resolve a similar issue I was having,I had an excel sheet that I export to a csv file, this is then uloaded elsewhere but requires the use of semicolons rather than commas for the character seperation, this worked fine when i was manually exporting the file as i had already changed the followingControl Panel >> Region and Language >> additonal settings >> List separatorfrom comma to semicolon.But when i tried to automate via VBA it defaulted back to comma,to fix I added the local paprameter as suggested by Christian Sauer above which then picks up the fact that i have changed my regional settings.

ActiveWorkbook.SaveAs Filename:="Filename.txt", FileFormat:=xlCSV, CreateBackup:=False, Local:=True

Thanks to Christian for the pointer.


Change Excel Options (Advanced, Editing options) to set Decimal separator to , (obviously (!))