Sub
neu()
Application.Workbooks(
"A.xlsx"
).Activate
With
Worksheets(
"Tabelle1"
)
For
peter = 2
To
500
If
Cells(peter, 12).Value =
""
Then
Exit
For
End
If
Next
End
With
Susi = peter - 1
Application.Workbooks(
"B.xlsx"
).Activate
With
Worksheets(
"TEMPLATE"
)
For
Ilka = 2
To
500
If
Cells(Ilka, 1).Value =
""
Then
Exit
For
End
If
Next
End
With
Herbert = Ilka - 1
Application.Workbooks(
"A.xlsx"
).Activate
With
Worksheets(
"Tabelle1"
)
For
Petra = 2
To
Susi
Cells(Petra, 13).Copy
Application.Workbooks(
"B.xlsx"
).Activate
Cells(1, 15).
Select
ActiveSheet.Paste
With
Workbooks(
"B.xlsx"
).Worksheets(
"TEMPLATE"
)
For
Georg = 2
To
Herbert
Cells(Georg, 12).
Select
If
InStr(ActiveCell.Value, Cells(1, 15).Value) > 0
Then
ActiveCell.Offset(0, -5).
Select
ActiveCell.Copy
Application.Workbooks(
"A.xlsx"
).Activate
Cells(Petra, 14).
Select
ActiveSheet.Paste
Exit
For
End
If
Next
End
With
Next
End
With
End
Sub