markjohnson002
New Member
- Joined
- Jun 12, 2007
- Messages
- 15
I have the ability to populate a report in excel, giving me two months worth of data for employees one after the other - if theres only one line then the employee is new. E.G
What i want to be able to do is press a button (macro) so that the document will insert a line everytime an employee has two months worth of data and subtract the top line from the bottom line to give me the differences. Rather like:
Is it possible to have a macro to do this for me.. the sheet could be up to 2000 employees?
Thankyou for anyone that could assist me.
Excel Workbook | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
5 | Employee No. | Employee Name | Salary | Basic Days | Basic Hours | Basic Pay | Bounty Payment | Bounty Payment Gross | ||
608 | 100 | Person, A | 1625.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
609 | 100 | Person, A | 1625.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
610 | 200 | Person, B | 0.00 | 0.00 | 222.00 | 0.00 | 0.00 | 0.00 | ||
611 | 300 | Person, C | 1666.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
612 | 300 | Person, C | 1666.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
613 | 400 | Person, D | 0.00 | 0.00 | 1067.50 | 0.00 | 0.00 | 0.00 | ||
614 | 400 | Person, D | 0.00 | 73.50 | 1029.00 | 0.00 | 0.00 | 0.00 | ||
615 | 500 | Person, E | 4066.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
616 | 500 | Person, E | 4066.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
617 | 33345 | Person, H | 2358.33 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
618 | 33345 | Person, H | 2358.33 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
First Sheet |
What i want to be able to do is press a button (macro) so that the document will insert a line everytime an employee has two months worth of data and subtract the top line from the bottom line to give me the differences. Rather like:
Excel Workbook | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
5 | Employee No. | Employee Name | Salary | Basic Days | Basic Hours | Basic Pay | Bounty Payment | Bounty Payment Gross | ||
608 | 100 | Person, A | 1625.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
609 | 100 | Person, A | 1625.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
610 | * | NO DIFFERENCE | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
611 | 200 | Person, B | 0.00 | 0.00 | 222.00 | 0.00 | 0.00 | 0.00 | ||
612 | * | NEW EMPLOYEE | 0.00 | 0.00 | 222.00 | 0.00 | 0.00 | 0.00 | ||
613 | 300 | Person, C | 1666.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
614 | 300 | Person, C | 1666.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
615 | * | NO DIFFERENCE | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
616 | 400 | Person, D | 0.00 | 0.00 | 1067.50 | 0.00 | 0.00 | 0.00 | ||
617 | 400 | Person, D | 0.00 | 73.50 | 1029.00 | 0.00 | 0.00 | 0.00 | ||
618 | * | DIFFERENCE | 0.00 | -73.50 | 38.50 | 0.00 | 0.00 | 0.00 | ||
619 | 500 | Person, E | 4066.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
620 | 500 | Person, E | 4066.67 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
621 | * | NO DIFFERENCE | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
622 | 33345 | Person, H | 2358.33 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
623 | 33345 | Person, H | 2358.33 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
624 | * | NO DIFFERENCE | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ||
First Sheet |
Is it possible to have a macro to do this for me.. the sheet could be up to 2000 employees?
Thankyou for anyone that could assist me.