Habe eine entsprechendes Makro in der Faq gefunden. Es kommt aber beim ausführen immer der Fehler "Fehler beim Kompilieren: Auserhalb einer Prozedur ungültig". Bin leider kein Excel Profi und verstehe deshalb nur Bahnhof.
Hier das script:
StandardModule: Modul1
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
-----------
Es wäre auch gut wenn nur ein Makierter Bereich exportiert würde.
Gruß
Carsten