in folgendem Makro wird die Mappe als TXT gespeichert, allerdings möchte ich die Abfrage wohin die Datei gespeichert wird umgehen und diese immer auf Laufwerk d:\ abspeichern. Wie müsste das Makro geändert werden?
Danke,
Uwe
Sub Text_File_erstellen()
Dim wks As Worksheet
Dim varFile As Variant
Dim strText As String
Dim Zeile As Long, FF As Integer
varFile = Application.GetSaveAsFilename(InitialFileName:="Text.txt", _
Filefilter:="Textfiles (*.txt), *.txt", _
Title:="Bitte Namen der Textdatei wählen/eingeben")
If varFile = False Then Exit Sub
FF = FreeFile()
Set wks = ActiveSheet
Open varFile For Output As #FF
With wks
For Zeile = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
strText = "[" & .Cells(Zeile, 1).Text & "];[" _
& .Cells(Zeile, 2).Text & "]_[" _
& .Cells(Zeile, 3).Text & "]_[" _
& .Cells(Zeile, 4).Text & "]"
Print #FF, strText
Next Zeile
End With
Close #FF
Set wks = Nothing
End Sub