Dim
intLetzteZ
As
Long
Dim
wbziel
As
Workbook
With
ThisWorkbook.Sheets(
"Data"
)
intLetzteZ = .Cells(Rows.Count, 1).
End
(xlUp).Row
.Range(.Cells(2, 1), .Cells(intLetzteZ, .UsedRange.SpecialCells(xlLastCell).Column)).Copy
If
.Cells(2, 1).Value =
"WB1"
Then
Set
wbziel = WB1
Else
Set
wbziel = WB2
End
If
End
With
With
wbziel
intLetzteZ = .ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
.ActiveSheet.Range(
"a"
& intLetzteZ).PasteSpecial Paste:=xlPasteValues
.ActiveSheet.Range(
"a"
& intLetzteZ).PasteSpecial Paste:=xlPasteFormats
End
With