Bräuchte mal Hilfe.
Mein Problem: einzelne Blätter als TXT-Datei speichern mit Dateiname aus Zelle und alles in einer Schleife, nicht wie der aufgezeichnete Code. In Tab1 Range D16:D20 sind die Dateinamen, ausser Tab1 alle Blätter (1,2,3,4,5) speichern im Pfad C:\Import.
Mit Makrorecorder aufgezeichneter Code
Sub BlaetterKopierenEinzelnSpeichern()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("1").Copy
ActiveWorkbook.SaveAs filename:="C:\Import\" & ThisWorkbook.Sheets("Tab1").Range("D16") & ". _
txt", FileFormat:=xlUnicodeText, CreateBackup:=False
ActiveWindow.Close
Sheets("Tab1").Select
Sheets("2").Copy
ActiveWorkbook.SaveAs filename:="C:\Import\" & ThisWorkbook.Sheets("Tab1").Range("D17") & ". _
txt", FileFormat:=xlUnicodeText, CreateBackup:=False
ActiveWindow.Close
Sheets("Tab1").Select
Sheets("3").Copy
ActiveWorkbook.SaveAs filename:="C:\Import\" & ThisWorkbook.Sheets("Tab1").Range("D18") & ". _
txt", FileFormat:=xlUnicodeText, CreateBackup:=False
ActiveWindow.Close
Sheets("Tab1").Select
Sheets("4").Copy
ActiveWorkbook.SaveAs filename:="C:\Import\" & ThisWorkbook.Sheets("Tab1").Range("D19") & ". _
txt", FileFormat:=xlUnicodeText, CreateBackup:=False
ActiveWindow.Close
Sheets("Tab1").Select
Sheets("5").Copy
ActiveWorkbook.SaveAs filename:="C:\Import\" & ThisWorkbook.Sheets("Tab1").Range("D19") & ". _
txt", FileFormat:=xlUnicodeText, CreateBackup:=False
ActiveWindow.Close
Sheets("Tab1").Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Für Hilfestellungen bedanke ich mich im Voraus!!!
Office Version 2016 Pro 32bit - Windows10 Pro 64 bit
"Wenn du jemanden ohne Lächeln triffst, schenke ihm dein's!"