How do you go through each employee number and see if they have 2 codes to their ID?

jojo52479

New Member
Joined
Mar 2, 2017
Messages
24
I was given a project to go through each employee ID going back to the first employee and see when they switched from union to nonunion. Below is an example of my spreadsheet. Using VBA, what code would I be able to use to go through each EE# and determine when they switch to union codes 99, 87, and 88. Untimely, I want to only keep the EE# that went to those union codes and delete the EE that dont have these union codes. Any assistance could help. I have over 300K of lines so going one EE at a time wouldnt work.

[TABLE="width: 225"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]EE#[/TD]
[TD]Hire Date[/TD]
[TD]Union Code[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/10/1998[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7/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TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]58C[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]3/11/1988[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
If your system cannot create the dictionary, then there is no point in sending me the file.
The code I supplied works fine on my system.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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