Sub sbDelete()
Dim lloZeile As Long
For lloZeile = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Range("A" & lloZeile).Value = "Peter Müller" Or _
Range("A" & lloZeile).Value = "Rene Krämer" Then
Rows(lloZeile & ":" & lloZeile).Delete Shift:=xlUp
End If
Next
End Sub
Hilfts?Sub sbDelete()
Dim lloZeile As Long
For lloZeile = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Range("A" & lloZeile).Value <> "Peter Müller" And _
Range("A" & lloZeile).Value <> "Rene Krämer" Then
Rows(lloZeile & ":" & lloZeile).Delete Shift:=xlUp
End If
Next
End Sub
Sub sbDelete()
Dim lloZeile As Long
For lloZeile = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Range("A" & lloZeile).Value <> "Peter Müller" And _
Range("A" & lloZeile).Value <> "Rene Krämer" Then
Rows(lloZeile & ":" & lloZeile).Delete Shift:=xlUp
End If
If Range("G" & lloZeile).Value = 0 Then
Rows(lloZeile & ":" & lloZeile).Delete Shift:=xlUp
End If
Next
End Sub
Option Explicit
Sub Test()
Dim MeAR(), varCol, varAnzahl
Dim A As Long, booGefunden As Boolean
Dim oSHTabelle As Worksheet
Application.ScreenUpdating = False
Set oSHTabelle = Sheets("Tabelle1") 'Tabellenname anpassen
With oSHTabelle.UsedRange
varCol = Application.Match("Name", .Rows(1), 0)
MeAR = .Columns(varCol).Value2
For A = 1 To Ubound(MeAR)
varAnzahl = Split(MeAR(A, 1), " ")
If Ubound(varAnzahl) = 24 Then
MeAR(A, 1) = "=TRUE"
booGefunden = True
Else
MeAR(A, 1) = "=ROW()"
End If
Next A
If A > 1 And booGefunden Then
With .Columns(.Columns.Count).Offset(0, 1)
.FormulaR1C1 = MeAR
oSHTabelle.UsedRange.Sort Key1:=.Cells(1, 1), Order1:=xlAscending, Header:=xlYes
On Error Resume Next
.SpecialCells(xlCellTypeFormulas, 4).EntireRow.Delete
.EntireColumn.Delete
On Error GoTo 0
End With
End If
End With
Application.ScreenUpdating = True
End Sub
Gruß Tino