Search code examples
excelcsvlocalevba

Save as CSV with semicolon separator


I'm currently use this function for saving, but I have a problem with it:

Private Sub spara()
    ActiveWorkbook.SaveAs Filename:="T:\filepath+ ActiveWorkbook.Name", _
    FileFormat:=xlCSV, CreateBackup:=False
End Sub

It automatically saves with , but I need it to save with ; in its file. Is it possible to change how it saves somehow?

I've tried googling around for this issue, but all macros regarding .csv file saving are just how to save in .csv and how to split multiple sheets to .csv .


Solution

  • 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...