ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   deleting rows conditional... help!!! (https://www.excelbanter.com/excel-discussion-misc-queries/201823-deleting-rows-conditional-help.html)

laandmc

deleting rows conditional... help!!!
 
Is there a way to delete rows if they fit a condition?

For example:

Sheet 1 contains all the names.
Sheet 2 contains names I want to get rid of the whole row.
Sheet 3 what I want to end up with.

SHEET 1
A
B
C
D

SHEET 2
A
B

SHEET 3
C
D

Can anyone give me a step by step guide on how to do this please as I do not
know a lot on excel or visual basic.

Cheers


Ron de Bruin

deleting rows conditional... help!!!
 
Hi laandmc

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

Read the infor below the first macro and use this in the macro

If Not IsError(Application.Match(.Value, _
Array("jelle", "ron", "dave"), 0)) Then .EntireRow.Delete

'Or use this one with Application.Match if you want to check more values.
'in the cell. You can also use a range with the values to delete.
'Replace Array("jelle", "ron", "dave") with Sheets("Sheet1").Range("A1:A200")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laandmc" wrote in message ...
Is there a way to delete rows if they fit a condition?

For example:

Sheet 1 contains all the names.
Sheet 2 contains names I want to get rid of the whole row.
Sheet 3 what I want to end up with.

SHEET 1
A
B
C
D

SHEET 2
A
B

SHEET 3
C
D

Can anyone give me a step by step guide on how to do this please as I do not
know a lot on excel or visual basic.

Cheers



All times are GMT +1. The time now is 03:31 PM.

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