Is this possible ?

  • Thread starter Thread starter David Fickbohm
  • Start date Start date
D

David Fickbohm

I have a spreadsheet that has the word "other" in a
column. Other columns in the same row have the value zero.
Is there any way I can search through the spreadsheet and
delete all the rows that have the word "other" and 0 in
the next two columns?

I can use either the text "other" or the zero in the two
columns to the right of the column containing "other"


Thanks
Dave
 
Hi Dave
try the following macro (using column a for the search):

Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "Other" and _
Cells(RowNdx, "B").Value )= 0 and _
Cells(RowNdx, "C").Value = 0 Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub
 
You should be able to isolate them out with Data > Filter > Autofilter >
Custom > "does not = "other"", etc

Vaya con Dios,
Chuck, CABGx3
 
Back
Top