Im using this to search for content and clear the corresponding row.
I need to use it for several different cell contents, not only the two i listed here and it s becoming chaotic.
Is it possible to simply combine them?
Would be amazing if there s a way to just list them somewhat like this: If rng.Item(i).Value = "AUFWAND" or "GESAMT-TOTAL AUFWAND" or "" Then
I need to use it for several different cell contents, not only the two i listed here and it s becoming chaotic.
Is it possible to simply combine them?
Would be amazing if there s a way to just list them somewhat like this: If rng.Item(i).Value = "AUFWAND" or "GESAMT-TOTAL AUFWAND" or "" Then
VBA Code:
Sub ClearRow_AUFWAND()
Dim rng As Range
Set rng = ActiveSheet.UsedRange
For i = rng.Cells.Count To 1 Step -1
If rng.Item(i).Value = "AUFWAND" Then
rng.Item(i).EntireRow.Clear
End If
Next i
End Sub
Sub ClearRow_GESAMT_TOTAL_AUFWAND()
Dim rng As Range
Set rng = ActiveSheet.UsedRange
For i = rng.Cells.Count To 1 Step -1
If rng.Item(i).Value = "GESAMT-TOTAL AUFWAND" Then
rng.Item(i).EntireRow.Clear
End If
Next i
End Sub