This VBA macro, `RecalculateScores`, evaluates compatibility scores between mentors and...
This VBA macro, RecalculateScores
, evaluates compatibility scores between mentors and mentees based on criteria from two worksheets and writes the results to a third worksheet. Here's a detailed breakdown of what it does:
1. Sets Up Worksheets and Variables
The macro interacts with three worksheets:
- "Mentor Input": Contains mentor information.
- "Mentee Input": Contains mentee information.
- "Evaluation": Serves as the output sheet where compatibility scores are recorded.
It also defines variables for mentor and mentee attributes such as:
- Industry, skills, communication style, availability, personality, and goals.
- A score and weights for evaluating compatibility.
2. Clears Old Evaluation Data
The macro clears existing entries in the "Evaluation" worksheet, starting from row 2 onward. This ensures no old calculations interfere with new evaluations.
3. Loops Through Mentors and Mentees
The macro iterates through all mentors (rows in "Mentor Input") and then, for each mentor, loops through all mentees (rows in "Mentee Input") to compute a compatibility score between the pair.
4. Evaluates Compatibility for Each Mentor-Mentee Pair
For each mentor-mentee pair, the macro computes a compatibility score based on five weighted criteria:
a. Industry Match (30%)
- If the mentor's and mentee's industries match (case-insensitive), the score increases by 30% of the total score.
b. Skills vs. Goals Match (30%)
- The mentor’s skills (comma-separated) are checked against the mentee's goals (search for skills as substrings in goals).
- If at least one skill matches, the score increases by another 30%.
c. Communication Match (15%)
- If the mentor's and mentee's communication styles match, the score increases by 15%.
d. Availability Match (15%)
- If their availability matches, the score increases by 15%.
e. Personality Match (10%)
- If their personalities match, the score increases by 10%.
5. Writes Results to the "Evaluation" Sheet
For each mentor-mentee pair, the following is written in the "Evaluation" sheet:
- Column A: Mentor's identifier (assumed in column 1 of the "Mentor Input").
- Column B: Mentee's identifier (assumed in column 1 of the "Mentee Input").
- Column C: Rounded compatibility score (percentage).
After writing the data, the macro increments the row counter for logging the next pair.
Summary
In short:
- The macro compares mentors and mentees from two input worksheets.
- It calculates compatibility scores based on criteria like industry, skills, communication, availability, and personality.
- Results are stored in the "Evaluation" sheet as mentor ID, mentee ID, and the compatibility score (%).