Macro to find if a value matches a column, then compare with another workbook

OrangeFanatic

New Member
Joined
Jul 30, 2015
Messages
1
Hi everyone,

Each quarter, I receive three workbooks from different departments at my school:
Workbook 1. Student ID# and total grade
Workbook 2. List of student ID# in Mr.John’s class
Workbook 3. List of student ID# in Ms.Sue’s class

I am trying to build a macro that will produce a new 4th workbook with the following results:
A. List of student ID#s in Mr. John’s class with a total grade equal to a specific value
B. List of student ID#s in Ms. Sue’s class with a total grade equal to a specific value

Since I am focusing only on students that got 100% (full marks) on their grade, the specific value is the same for Mr.John’s and Ms.Sue’s class

Here is workbook 1: All student ID# and grade. Maximum grade value of 7 equals 100%. So students with any other grade other than 7 is not important for this macro.

Student IDGrade
1111117
3333335
4444440
2222223
5555557
6666666

<tbody>
</tbody>

Here is workbook 2: All student ID# in Mr.John’s class
Student ID
111111
444444
666666

<tbody>
</tbody>

Here is workbook 3: All student ID# in Ms.Sue’s class
Student ID
333333
222222
555555

<tbody>
</tbody>

And here is the expected results on new workbook 4:
(Sheet 1 Mr.John’s students with full marks of grade = 7 only)
Student ID
111111

<tbody>
</tbody>

(Sheet 2 Ms.Sue’s students with full marks of grade = 7 only)
Student ID
555555

<tbody>
</tbody>

Reading through the other posts across this forum and others, I understand that it is often times better to present the problem and goal rather than asking how to use a specific function as there are many ways to achieve the same thing in Excel.

I did try searching in other forums about how to use specific functions but was not able to piece together a working macro.

With your help, after the strategy is defined I pledge to edit this post with the kind of relevant keywords and phrases so that other people in the future with a similar problem can benefit from your knowledge and expertise.

Thank you in advance!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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