wie kann ich ein Excel-Sheet als Text-Datei speichern, bei der die Felder durch Semikolon getrennt sind und Dezimalzahlen ein Komma haben.
Oder geht das mit Excel nicht?
Gruß Holger
Sub ExportAsText()
Dim intFileNumber As Integer
Dim strExportFile As String
Dim wks As Worksheet
Dim strFile As String
Dim lngRow As Long
Dim intColumn As Integer
Dim strTMP As String
strExportFile = "d:\Export.txt"
intFileNumber = FreeFile
Set wks = ThisWorkbook.Worksheets(1)
Open strExportFile For Output As intFileNumber
With wks
For lngRow = 1 To .UsedRange.Rows.Count
For intColumn = 1 To .UsedRange.Columns.Count
strTMP = strTMP & CStr(.Cells(lngRow, intColumn).Value) & ";"
strFile = strFile & strTMP
strTMP = ""
Next
strFile = strFile & vbCrLf
Next
End With
Print #intFileNumber, Left(strFile, Len(strFile) - 1);
Close #intFileNumber
End Sub
Gruß