Hi,
I'm working on a payroll type project. Each month I download pay data from the internet into an excel worksheet, worksheet 1. Column A has the account number, Column B is the description, and Column C is the amount. I want to create a macro that goes through the account numbers in column A and checks whether or not there is a number in column C of the same row. If there is, then I want the amount to be pasted into worksheet 2. Worksheet 2 has a table, . There are times when an account has two amounts. When they are put into worksheet 2 they will go in the same cell so I'd like them added together.
Below is an example of both worksheets. The first row of each section in worksheet 1 is the department number and description. The first cell in each section has the department number followed by the account number (ie 0300-5110 is department 300 account 5110). From worksheet 1 I want cells C2 and C3 added together and pasted into worksheet 2 cell B2. Then also, there are double departments sometimes, so dept 0500 is made up of corporate A and B. I'd like those added together. For example, C8, C9, C14 and C15 all added together and pasted into cell C2 of worksheet 2
Worksheet 1
Worksheet 2
Let me know if you need further clarification. Thanks for your input.
I'm working on a payroll type project. Each month I download pay data from the internet into an excel worksheet, worksheet 1. Column A has the account number, Column B is the description, and Column C is the amount. I want to create a macro that goes through the account numbers in column A and checks whether or not there is a number in column C of the same row. If there is, then I want the amount to be pasted into worksheet 2. Worksheet 2 has a table, . There are times when an account has two amounts. When they are put into worksheet 2 they will go in the same cell so I'd like them added together.
Below is an example of both worksheets. The first row of each section in worksheet 1 is the department number and description. The first cell in each section has the department number followed by the account number (ie 0300-5110 is department 300 account 5110). From worksheet 1 I want cells C2 and C3 added together and pasted into worksheet 2 cell B2. Then also, there are double departments sometimes, so dept 0500 is made up of corporate A and B. I'd like those added together. For example, C8, C9, C14 and C15 all added together and pasted into cell C2 of worksheet 2
Worksheet 1
0300 | Finance | |
0300-5110 | Wages | 500 |
0300-5110 | Vacation | 200 |
0300-5455 | LTD | 100 |
0300-5411 | Parking | |
0500 | Corporate A | |
0500-5110 | Wages | 500 |
0500-5110 | Vacation | 80 |
0500-5455 | LTD | 120 |
0500-5450 | GST | |
0500 | Corporate B | |
0500-5110 | Wages | 250 |
0500-5110 | Vacation | 100 |
0500-5455 | LTD | 90 |
0500-5212 | Pension | 80 |
Worksheet 2
0300 | 0500 | |
5110 | ||
5455 | ||
5411 | ||
5450 | ||
5212 |
Let me know if you need further clarification. Thanks for your input.