ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting a Row or Rows (https://www.excelbanter.com/excel-programming/375742-deleting-row-rows.html)

Big H

Deleting a Row or Rows
 
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



Ron de Bruin

Deleting a Row or Rows
 
There are a few ways Big H

See
http://www.rondebruin.nl/delete.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Big H" wrote in message ...
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




ChadF

Deleting a Row or Rows
 
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



"Big H" wrote:

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





All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com