Option
Explicit
Sub
bereich_kopieren()
Dim
Mappe1
As
Worksheet
Dim
ControllingIstzeitBsp
As
Worksheet
Dim
Cella
As
Range
Dim
Cellb
As
Range
Set
Mappe1 = ActiveWorkbook.ActiveSheet
Set
ControllingIstzeitBsp = Workbooks.Open(Filename:=
"G:\EGREV\GB 2\Organisatorisches\TEMP - Controlling\ControllingIstzeitBsp.xls"
).Worksheets(1)
For
Each
Cella
In
ControllingIstzeitBsp.Range(
"D1:D"
& ControllingIstzeitBsp.Cells(ControllingIstzeitBsp.Rows.Count,
"D"
).
End
(xlUp).Row)
For
Each
Cellb
In
ControllingIstzeitBsp.Range(
"F1:F"
& ControllingIstzeitBsp.Cells(ControllingIstzeitBsp.Rows.Count,
"F"
).
End
(xlUp).Row)
If
InStr(1, Cella,
"LAUF"
, vbTextCompare) > 0
And
Cellb.Value =
"Ergebnis"
Then
ControllingIstzeitBsp.Rows(Cella.Row).copy Destination:=Mappe1.Rows(Cella.Row)
End
If
Next
Cellb
Next
Cella
ControllingIstzeitBsp.Parent.Close
Set
ControllingIstzeitBsp =
Nothing
Set
Mappe1 =
Nothing
End
Sub