Deleting a Row or Rows

  • Thread starter Thread starter Big H
  • Start date Start date
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
 
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
 
Back
Top