ich benötige ein Makro, welches mir die komplette Zeile löscht, wenn in Spalte B eine 0 steht
ist das möglich?
Vielen Dank
Ulli
Sub zeilen_löschen()
dim x as integer
dim wert as string
dim bereich
For x = 1 To 100
wert = Cells(x, 2)
If wert = "0" Then bereich = Cells(x, 1).Address Then
Range(bereich).Select
Selection.EntireRow.Delete
bereich = ""
End If
Next
End Sub
Sub zeilen_löschen()
Dim x As Integer
Dim wert As String
Dim bereich
For x = 1 To 100
wert = Cells(x, 2)
If wert = "0" Then
bereich = Cells(x, 1).Address 'Then
Range(bereich).Select
Selection.EntireRow.Delete
bereich = ""
End If
Next
End Sub
Sub Zeilen_mit_0_löschen()
Application.ScreenUpdating = False
z = Range("B65536").End(xlUp).Row
For i = z To 1 Step -1
If Cells(i, 2) = 0 Then
Rows(i).EntireRow.Delete
End If
Next i
Application.ScreenUpdating = True
End Sub