LZF 1004
10.07.2018 12:29:55
Torsten
stehe mal wieder auf der Leitung, glaube ich. Bei folgendem Code zum kopieren von einer Datei in eine andere bekommen ich o.g. Laufzeitfehler mit Meldung:
"Copy method of Range class failed"
in der Zeile
.UsedRange.Copy Destination:=Workbooks(Filename).Sheets("Data UTL").Range("A" & Rows.Count).End(xlUp).Row + 1
Wo liegt mein Fehler?
Path = "Mein Pfad\"
Filename = Dir(Path & "Test.xlsx")
Application.ScreenUpdating = False
Application.CutCopyMode = False
Workbooks.Open Filename:=Path & Filename
With ThisWorkbook.Sheets("Data UTL")
.Visible = True
.UsedRange.Copy Destination:=Workbooks(Filename).Sheets("Data UTL").Range("A" & Rows.Count). _
_
End(xlUp).Row + 1
.UsedRange.EntireRow.Delete
End With
Workbooks(Filename).Save
Workbooks(Filename).Close False
Application.CutCopyMode = True
Application.ScreenUpdating = True
Bitte um Hilfe. Danke.Gruss Torsten