Gruppe
Extern
Problem
Wenn ich eine Excel-Tabelle als CSV-Datei speichere, wird das Semikolon als Feldseparator gesetzt, steuere ich diese Vorgang über ein englischsprachiges Makro, das Komma. Wie kann ich das ändern?
StandardModule: basMain
Sub Export()
Dim iRow As Integer, iCol As Integer
Dim sTxt As String, sSep As String
sSep = Range("G2").Value
On Error GoTo ERRORHANDLER
Close
Open Range("G1").Value For Output As #1
On Error GoTo 0
For iRow = 1 To 5
For iCol = 1 To 5
sTxt = sTxt & Cells(iRow, iCol).Value & sSep
Next iCol
sTxt = Left(sTxt, Len(sTxt) - 1)
Print #1, sTxt
sTxt = ""
Next iRow
MsgBox "Datei wurde angelegt:" & vbLf & Range("G1").Value
End
ERRORHANDLER:
MsgBox "Bitte überprüfen Sie den Verzeichnisnamen!"
End Sub