Warum for ohne next?
15.12.2016 18:35:52
Christof
LG Christof
Sub Prüfen()
Application.ScreenUpdating = False
Dim ZählerNeu As Long
Dim ZeilenNeu As Long
ZeilenNeu = Workbooks("Schäden in Vorlage tool").Sheets("Neu").Range("A" & Rows.Count).End(xlUp) _
.Row
For ZählerNeu = 1 To ZeilenNeu
Dim Zeile As Long
Dim Suchkriterium As String
Suchkriterium = Workbooks("Schäden in Vorlage tool").Sheets("Neu").Cells(ZählerNeu, 2). _
Value
Zeile = Workbooks("Schäden in Vorlage tool").Sheets("Alt").Columns("B:B").Find(What:= _
Suchkriterium, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Row
If Workbooks("Schäden in Vorlage tool").Sheets("Neu").Cells(ZählerNeu, 7).Value = _
Workbooks("Schäden in Vorlage tool").Sheets("Alt").Cells(Zeile, 7).Value Then
Workbooks("Schäden in Vorlage tool").Sheets("Neu").Row(Zeile).Copy
Dim ZeilenPrüfung As Long
ZeilenPrüfung = Workbooks("Schäden in Vorlage tool").Sheets("Prüfung").Range("A" & Rows. _
Count).End(xlUp).Row
Workbooks("Schäden in Vorlage tool").Sheets("Prüfung").Row(ZeilenPrüfung).Paste
Next
Application.ScreenUpdating = Ture
End Sub