hier noch mit Sortierung
25.06.2013 06:38:58
Matthias
Hallo
Sub KopierenBedingung2()
Dim Z1 As Long, Z2 As Long
Z2 = Sheets("Tabelle2").Cells(Rows.Count, 2).End(xlUp).Row + 1
For Z1 = Cells(65536, 3).End(xlDown).Row To 3 Step -1
If Cells(Z1, 7) = "fertig" Then
If Z2 = 65536 Then
MsgBox "In Tabelle2 ist keine Zeile mehr frei.", vbCritical
Exit Sub
End If
Range(Cells(Z1, 2), Cells(Z1, 6)).Copy Destination:=Sheets("Tabelle2").Cells(Z2, 2)
Z2 = Z2 + 1
Rows(Z1).ClearContents
End If
Next Z1
With Sheets("Tabelle2")
.Range("B2:F" & Z2).Sort Key1:=.Range("B3"), Order1:=xlAscending, Header:=xlYes
End With
End Sub
Gruß Matthias