This project is a simple Employee Management System built in Excel using VBA. It allows you to add, and delete employee records efficiently, directly in Excel, without manually formatting or managing tables.
-
Add Unique Employees
- Adds employee records from a source sheet (
Sheet1) to a styledOutputSheet. - Avoids duplicate EmployeeIDs.
- Highlights the first column (headers) in dark magenta with white bold text.
- Data column has dark magenta font.
- Each employee record is displayed as a vertical table with an outer border in dark magenta.
- Messages displayed:
"Missing values"→ if any field is empty."Duplicate record"→ if EmployeeID already exists."Record(s) updated successfully!"→ after all valid records are added.
- Adds employee records from a source sheet (
-
Delete Employee Record
- Deletes an employee record from
OutputSheetby EmployeeID. - EmployeeID to delete is entered in cell H11 on
Sheet1. - Confirms deletion with a “Are you sure you want to delete?” message.
- Deletes the entire table block and shifts remaining tables up.
- Clears H11 automatically after deletion.
- Shows confirmation message:
"Record deleted"or"EmployeeID not found".
- Deletes an employee record from
-
Data Styling & Formatting
- All employee tables have outer borders in dark magenta.
- Header column is bold, white text on dark magenta background.
- Data column is dark magenta text.
- Proper alignment and spacing for readability.
- Create
Sheet1for input data. - Add column headers in Row 1:
- Enter employee data starting from Row 2.
- Create
OutputSheet. - This sheet will automatically display all employee records added via the macro.
- Open VBA Editor (
Alt + F11), insert a module, and paste the macro. - The macro will:
- Loop through all employees in
Sheet1. - Skip duplicates or missing data.
- Add new tables in
OutputSheetwith proper styling and borders. - Show a single “Record(s) updated successfully!” message after completion.
- Paste the macro in the same module.
- Workflow:
- Enter EmployeeID in H11 on
Sheet1. - Click the Delete button assigned to this macro.
- Confirm deletion in the prompt.
- Macro deletes the table and clears H11 automatically.
- Go to
Developer → Insert → Button. - Assign AddUniqueEmployees macro to an “Add Record” button.
- Assign DeleteEmployeeRecord macro to a “Delete Record” button.
- Add a few employees in
Sheet1. - Click the Add Record button.
- Verify that the table is generated correctly in
OutputSheet. - Enter an EmployeeID in H11, click Delete Record, and confirm deletion.
- Add Update Record functionality.
- Add search functionality by EmployeeID or Name.
- Export tables to PDF or another workbook.
- Create a mini Excel dashboard for employee statistics.
This project demonstrates how Excel VBA can be used to manage employee data efficiently, combining automation, styling, and user-friendly prompts. It’s a great example for anyone learning Excel macros and data automation.