Help!!!! Vba code to delete rows in one sheet based on criteria from another sheet...

jyeezo83

New Member
Joined
Dec 3, 2015
Messages
1
Hi I am a newbie to Excel VBA Coding so take it easy on me i this is a stupid question.

So, I will try to explain what I need as best I can:

So, I have a spreadsheet (we'll call it S1) that has over 3000 rows of data. Each row corresponds to a customer that has various customer related columns of data. I go through each customer row and use the data in various systems for work. Based on the outcome of my query, each customer row has a "Completed" or "Needs Follow-Up" at the end of each row.

After about 2 weeks, I get a newer updated spreadsheet (we'll call it S2) based on the activity of the previous weeks. Sometimes, some of the customers that I worked on in S1 also show up in S2.

What I need is a VBA code that will search the customers in S2 and if they also appear in S1, I want it to check to see if there is a "Completed" at the end of the row for the customer (in the S1 sheet, of course). If it does, I want that row to be deleted from S2. This is so I don't spend time looking up customer info that I have already worked on.

I need this to be a code that I can use on every new sheet that I get. So basically, I want the new sheet to be used to reference/compare customers on the previous or most recent sheet. So, think S2 to compare to S1. Then S3 to compare to S2, then S4 to compare to S3 and so on and so forth.

I hope that this hasn't already been explained. I was unable to find it if so. Thanks in advance for your help.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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