Combine Workbooks

Rahulwork

Active Member
Joined
Jun 9, 2013
Messages
284
Hello Everyone,

i am working on a project and bit new on macro area

need to do some amendment in workbook saved in folder. please find below

I have an excel where i have button. now

in A1 there is path of folder and in B1 i have file name Test1.xlsx and in B2 Test2.xlsx (only one sheet would be there)

both the excel files has same header. so want when i click on button macro would
- open Test1.xlsx and Test2.xlsx and
- copy Test2.xlsx data from C3 to last filed column and row
- paste to the Test1.xlsx last filled row. and save and close both the file
- create a new folder named Consolidated
- copy test1.xlsx into that folder and rename as consolidated test


I know it's possible via code. please help me. its soo urgent
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,916
Office Version
  1. 365
Platform
  1. Windows
Have you tried using the Macro Recorder?
You can get a lot of the code you need just by turning on the Macro Recorder and performing these steps manually.
When you are done, stop the Macro Recorder and view your code.

You may need to do a little clean-up of the code afterwards to make it a little more concise and dynamic, but this will give you much of the code that you need.

Note, that if your data is continuous, you can get to the end of the data by going to cell C3, then selecting CTRL+SHIFT+*. This selects the Current Region (see: CurrentRegion Property in Excel VBA).

If you still need help cleaning up your code when you have finished doing this, just post back to the ticket with your code and explanation of what still needs to be done.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,567
Messages
5,596,904
Members
414,110
Latest member
docops

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top