Tabellenblatt als eigene Mappe kopieren
Hallo Leute,
ich habe folgenden Code zum speichern des zweiten Tabellenblattes im Forum bekommen (welches auch super funktioniert), jedoch möchte ich gerne nur die Werte aus der Tabelle speichern und nicht die Formate.
Wo muss ich was hinzufügen?
Option Explicit
Sub Blatt_kopieren_und_speichern()
Dim objNewWorkbook As Workbook
Application.ScreenUpdating = False
Sheets("Tabelle2").Cells.Copy
Set objNewWorkbook = Workbooks.Add
objNewWorkbook.Sheets(1).PasteSpecial
On Error GoTo ERRORHANDLER
Application.DisplayAlerts = False
objNewWorkbook.SaveAs Filename:="C:\Dokumente und Einstellungen\DATENAUSW.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
objNewWorkbook.Close
ERRORHANDLER:
Set objNewWorkbook = Nothing
Application.DisplayAlerts = True
End Sub
Antwort schreiben
Antwort 1 von Hajo_Zi vom 26.11.2021, 06:44 Options
objNewWorkbook.Sheets(1).PasteSpecial Paste:=xlValues
Antwort 2 von fetinci vom 27.11.2021, 09:11 Options
Hallo Hajo Zi,
vielen Dank für deine schnelle Rückmeldung. Leider konnte ich mich nicht eher melden. Irgendwie kann ich mit meinem Account nicht posten, da der Browser hängen bleibt, aber naja.
Ich bekomme bei wenn ich deinen Zusatz einfüge ein Fehlermeldung
"Laufzeitfehler 1004"
Gruß