S
scott
I'm trying to start at B1, then go down until I find a cell containing
"myword" and delete the row with "myword". I'm failing bad and need help.
I've looked at many examples like below, but can't get them to run.
Sub DeleteRows()
Dim theRange As Range, nCells As Integer, I As Integer
Set theRange = Selection
nCells = theRange.Cells.Count
For I = nCells To 1 Step -1
If theRange.Cells(I).Value = "myword" Then
theRange.Cells(I).EntireRow.Delete
End If
Next
End Sub
"myword" and delete the row with "myword". I'm failing bad and need help.
I've looked at many examples like below, but can't get them to run.
Sub DeleteRows()
Dim theRange As Range, nCells As Integer, I As Integer
Set theRange = Selection
nCells = theRange.Cells.Count
For I = nCells To 1 Step -1
If theRange.Cells(I).Value = "myword" Then
theRange.Cells(I).EntireRow.Delete
End If
Next
End Sub