avid.excel.user
New Member
- Joined
- Dec 29, 2010
- Messages
- 23
- Office Version
- 365
- 2019
- Platform
- Windows
Hi Friends,
I am struggling to search a piece of excel macro which can do the following steps for me :
1. I have individual excel sheets in 3 folders where the name of the file is the same and an unique identifier
for example : 1_test1.xlsx in folder C:\Macro\test1; 1_test2.xlsx in folder C:\Macro\test2; 1_test3.xlsx in folder C:\Macro\test3
2. Such a way i have excel sheets which are ranging from 1 to 4000
3. Each excel sheet has only 1 sheet named test1; test2; test3
4. Macro is needed to
a. Open the directory
b. create a new workbook with is 1.xlsx
c. open the worksheet 1_test1.xlsx
d. copy all data in test1 sheet from 1_test1.xlsx and paste it into 1.xlsx in sheet test1
e. close the worksheet 1_test1.xlsx
f. open the worksheet 1_test2.xlsx
g. copy all data in test2 sheet from 1_test2.xlsx and paste it into 1.xlsx in sheet test2
h. close the worksheet 1_test2.xlsx
i. open the worksheet 1_test3.xlsx
j. copy all data in test3 sheet from 1_test3.xlsx and paste it into 1.xlsx in sheet test3
k. close the worksheet 1_test3.xlsx
l. close 1.xlsx
re-run this from 1 to 100
Please help with a code, since i am breaking my head over it and still not found any thing related to this.
Thank You
I am struggling to search a piece of excel macro which can do the following steps for me :
1. I have individual excel sheets in 3 folders where the name of the file is the same and an unique identifier
for example : 1_test1.xlsx in folder C:\Macro\test1; 1_test2.xlsx in folder C:\Macro\test2; 1_test3.xlsx in folder C:\Macro\test3
2. Such a way i have excel sheets which are ranging from 1 to 4000
3. Each excel sheet has only 1 sheet named test1; test2; test3
4. Macro is needed to
a. Open the directory
b. create a new workbook with is 1.xlsx
c. open the worksheet 1_test1.xlsx
d. copy all data in test1 sheet from 1_test1.xlsx and paste it into 1.xlsx in sheet test1
e. close the worksheet 1_test1.xlsx
f. open the worksheet 1_test2.xlsx
g. copy all data in test2 sheet from 1_test2.xlsx and paste it into 1.xlsx in sheet test2
h. close the worksheet 1_test2.xlsx
i. open the worksheet 1_test3.xlsx
j. copy all data in test3 sheet from 1_test3.xlsx and paste it into 1.xlsx in sheet test3
k. close the worksheet 1_test3.xlsx
l. close 1.xlsx
re-run this from 1 to 100
Please help with a code, since i am breaking my head over it and still not found any thing related to this.
Thank You