Wo wird der txt gespeichert?
25.05.2004 09:37:19
Hanno
ich habe eben folgendes Macro bekommen. Es läuft auch ohne Probleme, doch leider weiß ich nicht, wo die txt-Datei daruafhin gespeichert wird.
Sub Export()
Dim rng As Range
Dim iFile As Integer, iRow As Integer, iCol As Integer
Dim sFile As String, sTxt As String
Set rng = Range("A1").CurrentRegion
sFile = Application.Path & "\testtext.txt"
iFile = FreeFile
Open sFile For Output As iFile
For iRow = 1 To rng.Rows.Count
For iCol = 1 To rng.Columns.Count
sTxt = sTxt & Cells(iRow, iCol).Value & vbTab
Next iCol
sTxt = Left(sTxt, Len(sTxt) - 1)
Print #iFile, sTxt
sTxt = ""
Next iRow
Close iFile
Workbooks.OpenText _
Filename:=sFile, _
DataType:=xlDelimited, _
tab:=True, _
semicolon:=False, _
comma:=False, _
Space:=False, _
other:=False
MsgBox "Weiter"
ActiveWorkbook.Close savechanges:=False
Kill sFile
End Sub
Könnt ihr mir helfen?
Danke, Hanno