Deleting rows with certain values in a column

  • Thread starter Thread starter kfo
  • Start date Start date
K

kfo

I am trying to delete rows on a worksheet, that have either a 10, 20
30, 40 or blank in a certain column. Is there a way for me to selec
the whole worksheet and run a macro or something
 
If that certain column is D, for example:
Sub RemoveRows()
'untested
for i=activesheet.usedrange.rows.count to 1 step -1
select case cells(i,4).value 'Col D
Case 10,20,30,40,""
rows(i).Delete
end Select
Next
End Sub
----- kfo wrote: -----

I am trying to delete rows on a worksheet, that have either a 10, 20,
30, 40 or blank in a certain column. Is there a way for me to select
the whole worksheet and run a macro or something.
 
Back
Top