Delete Certain Rows In Excel Based On Criteria

dci9497

New Member
Joined
Jul 18, 2011
Messages
8
Hello everyone,

First off, let me thank you for taking the time to answer so many questions! I don't know what I'd do without people such as yourselves.

Also, this is my first time posting; I've read the rules and guidelines, but if there is something I'm missing or did incorrectly, please pardon my ignorance.

On to the question:

I'm looking for VB code to delete rows only rows that I have specified. The data I'm trying to sort through contains user marks for people. Each user mark is three characters long and includes text and numbers.

There are about 200 rows in the sheet. I'd like to delete all the rows that do not list the user marks I have identified.

For example:

A1 234
A2 598
A3 tol
A4 rlv
A5 fks
A6 re3

This data above would be the original, without deleting. The using a macro/VB code to delete what I've specified
would then filter to:

A1 234
A2 tol
A3 re3

I hope I have explained my question clearly enough. I'm relatively new to VB and don't know where to begin in contructing the code for this.

I'm using Win XP and MS Office 2003.

If there are any details I have left out please let me know and I'll provide them to you immediately.

Thanks again for all your help!

dci9497
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Here is the idea:
Make a Database Tab that contains all the employees. The employee has one of two conditions, you either want to keep their data or delete it. Here is a picture of what I was thinking of.

ConditionsTab.jpg


You determine which ones you need.

You then copy or import your daily reports into a "Database" in column A. Column B has a formula in there to determine whether you want to keep or delete this employees data. Here is a picture.

DatabaseTab.jpg


After you you have imported the data you can then push the delete macro button which leaves you with only the ones you wanted to keep. Here is the results: Picture below.

DeleteButton.jpg


This is what I think you want.
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,916
Members
452,949
Latest member
beartooth91

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