Hi all,
I'm quite new no VBA, so trying to find my way here.
What I am trying to do is to copy a row of data from seperate Excel workbooks, located in different folders into one master sheet.
So what this looks like is that I have the following files in these locations:
C:\Users\username\Documents\Database\JohnJohnson\Data.xlsx
C:\Users\username\Documents\Database\PetePeterson\Data.xlsx
C:\Users\username\Documents\Database\MikeMicheals\Data.xlsx
and so on....
So what I am looking for is specifying these filepaths in my master sheet by concatenating cell contents to create this filepath so I know where to look for.
Let's say Sheet1 will have the file locations of where the code needs to search, so A1 will say 'C:\Users\username\Documents\Database\', B1 'John', C1 'Johnson', D1 '\Data.xlsx'.That concatenated will create: C:\Users\username\Documents\Database\JohnJohnson\Data.xlsx
Then I want my VBA code to look into that filepath, copy data from cell A1:F1, copy into Sheet2 of the mastersheet and then continue to the next file (PetePeterson), and copy this in the row underneath.
This will be a total of around 100 Data.xlsx files.
I hope this makes sense and you can help me with creating something for this!
Thanks!
I'm quite new no VBA, so trying to find my way here.
What I am trying to do is to copy a row of data from seperate Excel workbooks, located in different folders into one master sheet.
So what this looks like is that I have the following files in these locations:
C:\Users\username\Documents\Database\JohnJohnson\Data.xlsx
C:\Users\username\Documents\Database\PetePeterson\Data.xlsx
C:\Users\username\Documents\Database\MikeMicheals\Data.xlsx
and so on....
So what I am looking for is specifying these filepaths in my master sheet by concatenating cell contents to create this filepath so I know where to look for.
Let's say Sheet1 will have the file locations of where the code needs to search, so A1 will say 'C:\Users\username\Documents\Database\', B1 'John', C1 'Johnson', D1 '\Data.xlsx'.That concatenated will create: C:\Users\username\Documents\Database\JohnJohnson\Data.xlsx
Then I want my VBA code to look into that filepath, copy data from cell A1:F1, copy into Sheet2 of the mastersheet and then continue to the next file (PetePeterson), and copy this in the row underneath.
This will be a total of around 100 Data.xlsx files.
I hope this makes sense and you can help me with creating something for this!
Thanks!