ich habe ein Tabellenblatt welches mir als Vorlage dient.
Mein Ziel ist es, dieses per Makro mehrfach zu kopieren und als neue Datei in einen Pfad abzulegen.
Dazu habe ich bereits etwas im Forum gefunden, was sinngemäß funktioniert, jedoch werden die Kopien als Tabellenblatt in der Vorlage abgespeichert, ich benötige es jedoch als neue Datei.
Wer kann mir bei der Anpassung helfen?
Sub Tabellenblatt_Kopieren()
Dim i As Integer, Anzahl As Variant
Dim Vorlage As Worksheet
Static CalculationMode As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
CalculationMode = .Calculation
.Calculation = xlManual
.DisplayAlerts = False
End With
Set Vorlage = ThisWorkbook.Sheets("Vorlage")
Anzahl = InputBox("Welche Gesamtanzahl:", "Bitte gib die Anzahl der LK an!")
If Anzahl = "" Or Not IsNumeric(Anzahl) Then GoTo Fehler
For i = 0 To Anzahl - 1
Vorlage.Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = i + 1
Next
Application.ScreenUpdating = True
Exit Sub
Fehler:
MsgBox "Bitte gib eine natürliche Zahl an!"
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = CalculationMode
.DisplayAlerts = True
.StatusBar = False
End With
End Sub