Tim Hanson
Member
I can't figure out how to get my code to delete`all` rows with cells values of `privite` in column `F`
Only the first insurance is deleted
Thanks
Only the first insurance is deleted
Thanks
Code:
Sub RemovePrivate()
Dim rng As Range, cell As Range
Dim lRow As Long
Dim ws As Worksheet
Set ws = Sheets(1)
lRow = ws.Range("A" & ws.Rows.count).End(xlUp).Row
Set rng = ws.Range("F1:F" & lRow)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If cell.Text = "private" Then
cell.EntireRow.Delete
End If
Next
End If
End Sub