Public
Sub
Doppler_raus()
Dim
loLetzteQ
As
Long
Dim
loLetzteZ
As
Long
Application.ScreenUpdating =
False
loLetzteQ = Sheets(
"Tabelle1"
).Cells(Rows.Count, 3).
End
(xlUp).Row
loLetzteZ = Sheets(
"Tabelle2"
).Cells(Rows.Count, 3).
End
(xlUp).Row
For
i = loLetzteQ
To
2
Step
-1
If
Application.WorksheetFunction.CountIf(Sheets(
"Tabelle2"
).Range(
"C:C"
), Cells(i, 3)) > 0
Then
Rows(i).Delete
End
If
Next
i
loLetzteQ = Sheets(
"Tabelle1"
).Cells(Rows.Count, 3).
End
(xlUp).Row
With
Sheets(
"Tabelle1"
)
If
loLetzteQ > 1
Then
.Rows(
"2:"
& loLetzteQ).Copy
Sheets(
"Tabelle2"
).Rows(loLetzteZ + 1).Insert
Application.CutCopyMode =
False
Application.ScreenUpdating =
True
MsgBox
"Es wurden "
& loLetzteQ - 1 &
" neue Datensätze kopiert."
Else
Application.ScreenUpdating =
True
MsgBox
"Es sind keine neuen Daten vorhanden."
End
If
End
With
End
Sub