Thread
:
delete rows if data is either
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
delete rows if data is either
spelling?
spaces?
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"aileen" wrote in message
...
I'm trying to delete rows based on whether the data in column G is "adj"
or
"redi avg". I am using the following code, but it is only deleting the
rows
with "adj" in the cell:
Dim lr As Long, i As Long
lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
For i = lr To 1 Step -1
With ActiveSheet
If .Cells(i, 7) = "adj" Or .Cells(i, 7) = "redi avg" Then
.Cells(i, 1).EntireRow.Delete
End If
End With
Next
Please let me know how to get the rows with "redi avg" to delete also.
Thanks!
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett