Avatar of Jenkins
Jenkins
Flag for United States of America asked on

Copy data programmatically between Excel files

I have two Excel files (examples attached).

I've labeled one a Master File and the other a Transaction file.

The Master File gets much, but not all, of it's data from the Transaction File.

Each file contains around 200 rows.

The data is not arranged in the same order between the files and the order of each can't be changed.

There is a row name for each data row in each file but no naming convention between the two files.

What I mean by that is that there are instances where:

1. a particular row in the Master File may be related to a row in the Transaction file where the row
names DON'T match and you can't tell they are related.
2. a particular row in the Master File may be related to a row in the Transaction file where the row
names DO match.
3. a particular row in the Master File may be related to a row in the Transaction file where the row
names DON'T match exactly but are close enough to be able to tell they are related.

For reasons I won't bother to get into, the row names can't be changed.

I also am not going to link the files.


What I'm looking to be able to do is:

1. From the Master File, be able to click on a button that will open windows explorer and allow me to navigate to theTransaction File I want to select for "import".

2. Upon selecting the file, the program will, starting with the first (data) row name of the Master File (the row names are contained in column A of each file), search the row names in the Transaction File and if and when it finds the namein the Transaction File that is related to the name in the Master File, write the data in column 2 of the applicable row of the Transaction File to column 2 of the applicable row of the Master File.

3. Once the entire Transaction File is searched and a match is not found or a match is found and written to the Master File, the program should advance to the next row of the Master File and repeat the process.  Do this until the end of the Master File is reached.

If you look at the attached files and my notes in them, you should be able to see what I'm looking to achieve.


Thank you.
Master-File.xlsx
Transaction-File.xlsx
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Jenkins

8/22/2022 - Mon
Joe Winograd

Hi db,
Some questions:

(1) You note that processing in the Transaction File can start in the row after "Row Name" appears in column A, but when should processing stop? After the first empty cell in column A? After N consecutive empty cells in column A? After some "marker" text (i.e., a stop processing flag) in column A?

(2) How would the program know that the "acctg" transaction (or accnt, accntg, acctng, etc.) belongs in the "Accounting" row of the Master File? Or that the "mrktg" transaction (or mrktng, mktg, mktng, etc.) belongs in the "Marketing" row? Will you provide a list of such mappings? Or do you want the program to employ some heuristics, such as number of characters that match in the column name, to make the determination?

(3) You say that "when it finds the name in the Transaction File that is related to the name in the Master File, write the data in column 2 of the applicable row of the Transaction File to column 2 of the applicable row of the Master File". Do you mean that it should add the data in column 2 of the Transaction File to the value in column 2 of the Master File? Or should it overwrite whatever is there (meaning the last value "wins")? If neither of those, what do you mean by "write" it?

(4) What is your deadline/time-frame for needing this program?

(5) What is your budget for developing this program?

Regards, Joe
ASKER CERTIFIED SOLUTION
byundt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jenkins

ASKER
Thanks byundt
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23