1.1k Aufrufe
Gefragt in Tabellenkalkulation von
Hallo zusammen,

ich habe ein Makro, das mir wenn in Spalte M eine Zahl steht, diese Zeile ausschneidet und in ein andere Sheet einfügt.

Jetzt möchte ich aber, dass die gesamte Zeile nach dem ausschneiden gelöscht wird. Bekomm es aber leider nicht gebacken.


Private Sub Workbook_Open()
Dim lngLetzte As Long
Dim lngZeile As Long
With Worksheets("Erledigt")
lngLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 2)), .Cells(.Rows.Count, 2).End(xlUp).Row, .Rows.Count) + 1
End With
With Worksheets("Übersicht")
For lngZeile = IIf(IsEmpty(.Cells(.Rows.Count, 2)), .Cells(.Rows.Count, 2).End(xlUp).Row, .Rows.Count) To 2 Step -1
If .Cells(lngZeile, 13) >= 1 Then
.Range(.Cells(lngZeile, 1), .Cells(lngZeile, 21)).Cut Worksheets("Erledigt").Cells(lngLetzte, 1)
lngLetzte = lngLetzte + 1
End If
Next lngZeile
End With
End Sub



Weiß jemand von euch hierfür ne Lösung. Für eure Hilfe bedanke ich mich jetzt schon mal.

Florian

2 Antworten

0 Punkte
Beantwortet von hajo_zi Experte (9.1k Punkte)
Hallo Florioan,

.Range(.Cells(lngZeile, 1), .Cells(lngZeile, 21)).Cut Worksheets("Erledigt").Cells(lngLetzte, 1)
.rows(lngzeile).delete

Gruß hajo
0 Punkte
Beantwortet von
Hallo Hajo,

HEY SUPER. Hat funktioniert.

Vielen Dank.

Gruß

Florian
...