I was wondering if any of you can help me.
I have some experience with excel, but until now have not ventured into VBA and macros.
I have a workbook which will have the following sheets:
1.Absence Summary sheet - Summarises data from each employee's individual sheet.
2. Template Sheet - A sheet formatted as an absence record sheet, but without data.
3. Individual employee Absence record sheets - Based on the Template sheet.
I have read with interest the various posts and help files on User Forms & Macros, but have got a bit stuck.
My Aim:
UserForm containing -
"Surname" Text box;
"Initial" Text box;
"Employee Number" Text box;
"Start Date" Text box;
"Job Title" Combo Box, which offers 11 different Job Titles;
"Create Absence Sheet" Command Button (will explain aim of this in a mo);
"Clear Form" Command Button (in case of user error);
"Cancel" Command Button to allow user to exit user form.
I have programmed all of the contents of my user form so far using a tutorial I found on one of these pages and modifying it to my requirements.
I have also found some code to put in the Template sheet so that when the sheet is copied, it is renamed according to the name entered in cell E3, which I am pleased with.
What I am struggling with is what code to use with the "Create Absence Sheet" Command Button.
What I want to happen when the user clicks the "Create Absence Sheet" Command Button is:
1.Make a copy of the Template Sheet
2.Put the Surname into cell E3
3.Put the Initial into cell R3
4.Put the ERN (Employee Number) into cell AC3
5.Put the Job Title into cell E4
6.Put the Start Date into cell AC4
7.Rename the sheet (preferably using "Surname, Initial." format but can live with the result of the code I found).
8.Put the Surname into the "All Employees - Absence Summary" worksheet in the next available row of column B
9.Put the Initial into the into the "All Employees - Absence Summary" worksheet in the next available row of column C
10.Put the ERN into the "All Employees - Absence Summary" worksheet in the next available row of column D
11.Put the Start Date into the "All Employees - Absence Summary" worksheet in the next available row of column E
I can't attach my workbook for you to see, because the file size is larger than 100k. I appreciate that I am asking a lot, but even if you can just give me some pointers, I would be so grateful.
Bookmarks