Alex Campbell
asked on
Use VLookup or is there a macro that would be better?
The object of the exercise is to get the Trans Total from trans.xls into the Period Total column of master.xls by cross-referencing the Badge Number.
Trans is always a subset of Master, so the number of rows in trans.xls will never exceed the number of rows in master.xls.
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
The result should then be saved as summary_{date}.xls.
What can be tricky about this whole process is the following:
Every a week, the Accountant runs a report that summarizes all the transactions by badge and totals the transactions for the week.
The Accountant then exports the report to a CSV and sends it to a Junior Admin Person.
The Junior Admin Person currently manually cross-references the employee name and number and inserts it into a spreadsheet (Trans File) and sends it back to the Accountant who then sends it to corporate.
The Accountant *could* do it, but wants the Junior Admin Person to do it instead.
master.xls
trans.xls
Trans is always a subset of Master, so the number of rows in trans.xls will never exceed the number of rows in master.xls.
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
The result should then be saved as summary_{date}.xls.
What can be tricky about this whole process is the following:
Every a week, the Accountant runs a report that summarizes all the transactions by badge and totals the transactions for the week.
The Accountant then exports the report to a CSV and sends it to a Junior Admin Person.
The Junior Admin Person currently manually cross-references the employee name and number and inserts it into a spreadsheet (Trans File) and sends it back to the Accountant who then sends it to corporate.
The Accountant *could* do it, but wants the Junior Admin Person to do it instead.
master.xls
trans.xls
i think it would be easier to code a macro rather than using vlookup.
ASKER
Can you write the macro?
I would like a few clarifications before I attempt this.
- Will the trans sheet contain the badge numbers before running the macro
- Will this list in trans fixed or varying
- Could it be that the trans list is created based on non-zero values in master list
- At the moment the master list does not contain any value in the period total. There should be values present there to be posted to the trans.
- Will the trans sheet contain the badge numbers before running the macro
- Will this list in trans fixed or varying
- Could it be that the trans list is created based on non-zero values in master list
- At the moment the master list does not contain any value in the period total. There should be values present there to be posted to the trans.
ASKER
- Will the trans sheet contain the badge numbers before running the macro
yes
- Will this list in trans fixed or varying
Will vary
- Could it be that the trans list is created based on non-zero values in master list
No
- At the moment the master list does not contain any value in the period total. There should be values present there to be posted to the trans.
***Thinks it goes the other way: from Trans to Master, but will double-check with customer.***
"The object of the exercise is to get the Trans Total from trans.xls into the Period Total column of master.xls by cross-referencing the Badge Number.
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
The result should then be saved as summary_{date}.xls. "
--------------------------
The object of the exercise is to get the Trans Total from trans.xls into the Period Total column of master.xls by cross-referencing the Badge Number.
Trans is always a subset of Master, so the number of rows in trans.xls will never exceed the number of rows in master.xls.
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
The result should then be saved as summary_{date}.xls.
What can be tricky about this whole process is the following:
Every a week, the Accountant runs a report that summarizes all the transactions by badge and totals the transactions for the week.
The Accountant then exports the report to a CSV and sends it to a Junior Admin Person.
The Junior Admin Person currently manually cross-references the employee name and number and inserts it into a spreadsheet (Trans File) and sends it back to the Accountant who then sends it to corporate.
The Accountant *could* do it, but wants the Junior Admin Person to do it instead.
ASKER
Information below --------- was put there while I was editing. Meant to delete before sending.
ASKER
Checked with customer. The answers I gave above are correct.
This is an exerpt from the question
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
and this one from your response to my queries
***Thinks it goes the other way: from Trans to Master
You need to clarify this. If the latter is the case then my queries are no longer relevant.
Any badge number found in trans.xls should exist in master.xls. Whatever value is in Period Total will be overwritten to the Trans Total if badge numbers match, or be re-set to zero.
and this one from your response to my queries
***Thinks it goes the other way: from Trans to Master
You need to clarify this. If the latter is the case then my queries are no longer relevant.
So the statement in the question is wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Customer very pleased, but had one suggestion that instead of choosing all rows, just use a1 to B500. Covers any possible situation, but is much faster than whole column.