I want to import several columns from a workbook (closed) into a new workbook and be able to refresh the data every time the new workbook is open. Is this posible using import or I must use formulas?
I want to import several columns from a workbook (closed) into a new workbook and be able to refresh the data every time the new workbook is open. Is this posible using import or I must use formulas?
You can do it with import. If the columns you want to copy are next to each other, select them all and give them a name. If not, select them individually and give each a different name. Save & close the file. In the new workbook, click on the cell where you want the data to go and Data - Import External Data - Import Data. Navigate to the closed file, click on it and the new named ranges should appear. Select the first one and the data should appear in the new workbook. Repeat for the other names.
If you want the queries to refresh automatically when you open the file you can use the following code in the workbook module
![]()
Please Login or Register to view this content.
or just with a formula like
=[example.xls]Sheet1!A1
and copied down. You will be prompted if you want to update the cells when the workbook is opened.
Thanks for your suggestions. Teylyn, I new how to do it with a formula but the problem is that it works very sluggish using formula for import because I don't know exactly how many rows a specific column has. So it can be 5000 or 3498 etc. And thusly, I need to have a long range of these formulas to be sure I don't miss anything.
I will test your code Huron when I get home. Could be very usefull. Thank you both for replying.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks