Tabelle in txt Datei
02.12.2003 11:22:38
Pete
Möchte eine Tabelle in eine txt Datei exportiren, habe folgendes Makro, lieder funktioniert es nicht. Habe Daten von Spalte A:13 bis E10000
Die Datei bleibt immer leer!
Wer kann helfen?
Danke Pete!
Private Sub CommandButton4_Click()
Dim rng As Range
Dim iRow As Integer, iCol As Integer, iFile As Integer
Dim sFile As String, sTxt As String
Set rng = Range("A10000").CurrentRegion
sFile = Application.Path & "/Testtxt.txt"
iFile = FreeFile
Open sFile For Output As iFile
For iRow = 12 To rng.Rows.Count
For iCol = 1 To rng.Columns.Count
sTxt = sTxt & Cells(iRow, iCol).Value & ","
Next iCol
sTxt = Left(sText, Len(sTxt) - 1)
Print #iFile, sTxt
sTxt = ""
Next iRow
Close iFile
rng.ClearContents
MsgBox " Habe die Daten in eine Textdatei eingelesen!"
End Sub