Deleting rows based on a criteria

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
could any body please tell me if it is possible to delete some rows in an excel sheet based on a criteria..do i need to write some code in VBA or is there a feature in excel itself which will allow me to do that...i would greatly appreciate yur help in this..
thanx a lot..
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
On 2002-10-03 17:54, rajeevbhardwaj wrote:
thanks a lot buddy..
can yu also tell me how to do the same for cells..meaning deleting cells based on a criteria..

That would require VBA... Wait for someone else to take that up.
 
Upvote 0
could any body please tell me if it is possible to delete some rows in an excel sheet based on a criteria..do i need to write some code in VBA or is there a feature in excel itself which will allow me to do that...i would greatly appreciate yur help in this..
thanx a lot..

Hi rajeevbhardwaj:

As Aladin has already mentioned a truly programmatic approach would require VBA, but you could accomplish what you are looking for indirectly using ADVANCED FILTER.

The worksheet simulation shows your source data, the names to be deleted (in my example, "alka", "becky" and "joe") and the finally filtered list
y021003.xls
ABCDEFG
1
2FALSEalkabeckyjoe
3
4
5
6NAMENAME
7beckyrick
8joesal
9rickkate
10salnel
11katelena
12nelmona
13lena
14alkasourcedata
15monacriteria
16resultafterusingAdvancedFilter
17
Sheet7
</SPAN>

Please post back if it works for you -- otherwise explain a little further and let us take it from there.

Regards!

Yogi
 
Upvote 0
For i = 100 To 1 Step -1
If Cells(i, 3) <> Cells(i, 4) Then Cells(i, 3).EntireRow.Delete
Next
 
Upvote 0

Forum statistics

Threads
1,226,287
Messages
6,190,073
Members
453,593
Latest member
Mubashar Ali

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top