Deleting a Row or Rows

B

Big H

Hi there,

hopefully someone can help, is it possible to delete a row based on a
certain criteria?

I have a dynamic range of data in columns A:J, within column H, the header
is Region, and the criteria is one of the following: North, South,East or
West. Anything that has West on Column H, I want that row or rows to be
deleted.

Is it possible to do this using code.

regards BigH
 
G

Guest

Hi 'Big H'

might want to consider the following:

public sub zapWest()
Dim WestIter as Range

set WestIter = Cells(Range("H1").row, Range("H1").column)

Do while trim(WestIter.text) <> ""
if trim(WestIter.text) Like "[wW]est" then
Rows(WestIter.row).delete
end if

set WestIter = WestIter.Offset(1, 0)
Loop


end sub


Hope this helps.

Chad
 

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

Top