brauche eure Hilfe ich erreichen per buttonklick wenn in spalte B bis AJ eine null steht soll die zeile gelöscht werden
DANKE
VG
Sub Null_Zeilen_löschen()
Application.ScreenUpdating = False
Dim sp, z As Long
For z = Rows.Count To 1 Step -1
For sp = 2 To 36
Application.StatusBar = "lese Zeile " & z & ", " & sp
If Cells(z, sp) = "0" Then Rows(z).Delete
Next
Next
End Sub
Sub löschen()
Dim lngLast As Long
Dim lngStart As Long
Dim i As Long
Dim n As Variant
Dim Bereich1 As Range
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
On Error GoTo ErrH
With Sheets("Tabelle1")
Set Bereich1 = .Columns("B:AJ") 'ggf anpassen
lngStart = 5 ' Startzeile bitte anpassen
lngLast = .Cells.Find(What:="*", After:=.Range("A1"), _
SearchOrder:=xlByRows, Searchdirection:=xlPrevious).Row
For i = lngLast To lngStart Step -1
n = Application.Match(0, Bereich1.Range(.Cells(i, 1), Cells(i, Bereich1.Columns.Count)), _
0)
If Not IsError(n) Then
.Rows(i).Delete
End If
Next
End With
ErrH:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub