S
Snoopy
Hey guys
In some of the cells in column A - Range("A2:A") - there are
expressions including the frace/part: "\old\".
I want to remove all rows including this frace and keep the remaining
ones.
The nearest I can get is something like this, but (of cause) my
attempt was not very successful.
(Yeah - I know I stole/borrowed it from someone else and tryed to
ajust it ...forgive me)
Sub Delete_OLD_rows()
Dim cell As Range
Dim delRange As Range
For Each cell In Range("A2:B" & Range("A" & Rows.Count).End
(xlUp).Row)
If cell.Value = ""*\OLD\* Then
If delRange Is Nothing Then
Set delRange = cell
Else
Set delRange = Union(delRange, cell)
End If
End If
Next cell
If Not delRange Is Nothing Then delRange.EntireRow.Delete
End Sub
Wil you please help me?
Best regards
Snoopy
In some of the cells in column A - Range("A2:A") - there are
expressions including the frace/part: "\old\".
I want to remove all rows including this frace and keep the remaining
ones.
The nearest I can get is something like this, but (of cause) my
attempt was not very successful.
(Yeah - I know I stole/borrowed it from someone else and tryed to
ajust it ...forgive me)
Sub Delete_OLD_rows()
Dim cell As Range
Dim delRange As Range
For Each cell In Range("A2:B" & Range("A" & Rows.Count).End
(xlUp).Row)
If cell.Value = ""*\OLD\* Then
If delRange Is Nothing Then
Set delRange = cell
Else
Set delRange = Union(delRange, cell)
End If
End If
Next cell
If Not delRange Is Nothing Then delRange.EntireRow.Delete
End Sub
Wil you please help me?
Best regards
Snoopy