Dim
intLetzteZ
As
Long
Dim
intErsteZ
As
Long
Dim
intWrite
As
Long
intLetzteZ = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row
intErsteZ = 2
For
intErsteZ = intErsteZ
To
intLetzteZ
WBDatenVonHier.Activate
Sheets(
"Data"
).Activate
Rows(intErsteZ).Copy
If
Cells(intErsteZ, 1).Value =
"WB1"
Then
WB1.Activate
intWrite = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
Range(
"a"
& intWrite).PasteSpecial Paste:=xlPasteValues
Range(
"a"
& intWrite).PasteSpecial Paste:=xlPasteFormats
Else
WB2.Activate
intWrite = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
Range(
"a"
& intWrite).PasteSpecial Paste:=xlPasteValues
Range(
"a"
& intWrite).PasteSpecial Paste:=xlPasteFormats
End
If
Next
intErsteZ