ich habe im Archiv ein Makro gefunden, welches jede Zeile in jeweils eine txt-Datei schreibt.
https://www.herber.de/forum/archiv/1596to1600/1597522_Excel_Zeilen_als_einzelne_TextDateien_speichern.html#1597567
' Modul: Modul1 Typ: Allgemeines Modul
Option Explicit
Sub ErstelleDateien()
Dim strPath As String, strText As String, strDivider As String, strFileName As String
Dim lngRow As Long, lngStartRow As Long, lngLastRow As Long
Dim lngCol As Long, lngStartCol As Long, lngLastCol As Long
Dim FF As Integer
strPath = "C:\Users\Robert\Desktop\Skriptcode" 'Zielpfad
If Right(strPath, 1) "\" Then strPath = strPath & "\"
strDivider = ";" 'Trennzeichen der Textdatei - Anpassen
lngStartRow = 4 'Erste Zeile mit Daten
lngStartCol = 3 'Erste Spalte (Dateiname)
With Sheets("Speichern der Datei1") 'Tabellenname - Anpassen
lngLastRow = Application.Max(lngStartRow, .Cells(.Rows.Count, 4).End(xlUp).Row) 'letzte Zeile
lngLastCol = Application.Max(lngStartCol, .Cells(lngStartRow, .Columns.Count).End(xlToLeft). _
Column) 'letzte Spalte
For lngRow = lngStartRow To lngLastRow
strFileName = strPath & .Cells(lngRow, lngStartCol) & ".txt"
strText = ""
For lngCol = lngStartCol + 1 To lngLastCol
strText = strText & .Cells(lngRow, lngCol) & strDivider
Next
strText = Left(strText, Len(strText) - Len(strDivider))
FF = FreeFile
Open strFileName For Output As #FF
Print #FF, strText
Close #FF
Next
End With
End Sub
Gruß Sepp
Habe es für meine Bedürfnisse angepasst.Allerdings möchte ich, dass in der txt-Datei den Inhalt jeder Zelle in "XXXX" Anführungszeichen steht.
Z.B. "abcdefg";"hijklmn";"opqrstuv"
Das habe ich leider nicht hinbekommen.
Kann mir da bitte jemand helfen?
Vielen Dank