AW: Variabler Bereich kopieren
23.09.2017 18:24:17
Werner
Hallo Herbert,
teste mal:
Option Explicit
Public Sub kopieren()
Dim loLetzteQ As Long, loLetzteZ As Long
Dim wsQ As Worksheet, wsZ As Worksheet
Dim raBereich As Range
Application.ScreenUpdating = False
Set wsQ = ThisWorkbook.Worksheets("Uebertrag")
Set wsZ = ThisWorkbook.Worksheets("Kassabuch")
With wsQ
loLetzteQ = .Cells(.Rows.Count, 1).End(xlUp).Row
loLetzteZ = wsZ.Cells(wsZ.Rows.Count, 1).End(xlUp).Row + 1
Set raBereich = .Range(.Cells(2, 1), .Cells(loLetzteQ, 3))
raBereich.Copy
wsZ.Cells(loLetzteZ, 1).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End With
Application.ScreenUpdating = True
Set wsQ = Nothing
Set wsZ = Nothing
Set raBereich = Nothing
End Sub
Code gehört in ein allgemeines Modul.
Gruß Werner