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.

EE#Hire DateUnion Code
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/199858C
147/10/19988
147/10/19988
147/10/19988
147/10/19988
147/10/19988
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198828C
253/11/198858C
253/11/198858C
253/11/198858C
253/11/19888
253/11/19888
253/11/19888
253/11/19888

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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,216,350
Messages
6,130,139
Members
449,560
Latest member
mattstan2012

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