Hallo,
Ik gebruik het volgende script om data van een tabblad te exporteren naar CSV.
Nu heb ik het probleem dat excel als scheidingsteken de komma gebruik maar dit zit ook in de bedragen die geëxporteerd worden.
Heeft er iemand een aanpassing/toevoeging op het script om ervoor te zorgen dat het scheidingsteken een Punt Komma; wordt??
alvast bedankt voor jullie hulp.
Sub exportcsv()
Dim MyPath As String
Dim MyFileName As String
MyPath = "C:\excel test\"
MyFileName = "output" & Range("Blad2!A2") & Format(Date, "mmyyyy")
If Not Right(MyPath, 1) = "\" Then MyPath = MyPath & "\"
If Not Right(MyFileName, 4) = ".csv" Then MyFileName = MyFileName & ".csv"
Sheets("Blad2").Copy
With ActiveWorkbook
.SaveAs Filename:= _
MyPath & MyFileName, _
FileFormat:=xlCSV, _
CreateBackup:=False
.Close False
End With
End Sub
hier ook nog een voorbeeld bestand met het script erin: Bekijk bijlage Map1.xlsm )
Ik gebruik het volgende script om data van een tabblad te exporteren naar CSV.
Nu heb ik het probleem dat excel als scheidingsteken de komma gebruik maar dit zit ook in de bedragen die geëxporteerd worden.
Heeft er iemand een aanpassing/toevoeging op het script om ervoor te zorgen dat het scheidingsteken een Punt Komma; wordt??
alvast bedankt voor jullie hulp.
Sub exportcsv()
Dim MyPath As String
Dim MyFileName As String
MyPath = "C:\excel test\"
MyFileName = "output" & Range("Blad2!A2") & Format(Date, "mmyyyy")
If Not Right(MyPath, 1) = "\" Then MyPath = MyPath & "\"
If Not Right(MyFileName, 4) = ".csv" Then MyFileName = MyFileName & ".csv"
Sheets("Blad2").Copy
With ActiveWorkbook
.SaveAs Filename:= _
MyPath & MyFileName, _
FileFormat:=xlCSV, _
CreateBackup:=False
.Close False
End With
End Sub
Code:
hier ook nog een voorbeeld bestand met het script erin: Bekijk bijlage Map1.xlsm )