Macro to import list automatically from a workbook to another workbook

danish6061

New Member
Joined
Mar 16, 2020
Messages
44
Office Version
  1. 2016
Platform
  1. Windows
I have 2 workbooks with various columns I want to import some columns automatically from workbook A to workbook B. Is it possible?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
With both workbooks open, record a macro to do this (once) and then create a button and assign the macro to it.
 
Upvote 0
Thanxx Alansidman and Smith,
But could you explain me complete process, because I dont know anything about macro?
 
Upvote 0
Make sure that you have both workbooks open. In the workbook that you want the imported columns to be pasted into:
1. in the bottom left-hand corner of the workbook you will see an icon that looks like a camera. Click on it and a small window will open with "Macro1" highlighted. Type into this small box a meaningful name like "PasteFromWbk" and click on OK
2. Now simply carry out the steps you need to take to copy the columns from one workbook to the other
3. When you have completed this, click on the same icon (which is now just an empty square) that you did to start recording the macro
4. In the workbook with the macro, click on Insert/Text Box and type in a title e.g. Import Data.
5. Right click on the text box and assign macro (PasteFromWbk)
6. Save and close the workbooks, the workbook with the macro must be saved as a macro-enabled workbook
7. Re-open the workbook with the macro in it, delete the recently imported and then click on the text box to import the data

I hope this helps.

Mel
 
Upvote 0
Look on the ribbon then select Insert and Text Box
When you have drawn the text box, click in the middle of it and type in a meaningful name

Mel
 
Upvote 0
Brother its not working, it's showing "run time error 9 subscript out of range"
 
Upvote 0
Go over everything you've done to make sure that the ranges you are trying to copy and paste are correct and the destination cell(s) are correct also. The macro you recorded is using "absolute" references so if you said copy range A1:A65 and paste to (other workbook range) range B1, then then is what should happen EVERY time

Mel
 
Upvote 0
Also you MUST have both workbooks open for the macro to run
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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
Back
Top