ich wüßte gern, wie ich Daten in einer Textdatei anhängen kann. Das schreiben generell ist kein Problem, aber leider bekomme ich es nicht hin, die neuen Datensätze hinter die alten zu schreiben.
Kann es sein, dass es irgendwas mit Append zu tun hat?
Kann mir jemand helfen?
Gruß Andre
Hier mein Code:
Sub test()
lngZcnt = Sheets("Tabelle1").Range("A65536").End(xlUp).Row
intScnt = 3
strSep = ";"
strName = "Test"
strPfad = "C:\"
Close #1
sFile = strPfad & strName & ".txt"
Open sFile For Output As 1
For lngZeile = 1 To lngZcnt
strText = ""
For intSpalte = 1 To intScnt
strText = strText & CVar(Cells(lngZeile, intSpalte))
If intSpalte < intScnt Then strText = strText & strSep
Next
If lngZeile = lngZcnt Then Print #1, strText; Else Print #1, strText
Next
Close #1
End Sub