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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top