VBA Pull Data In from another workbook without opening that workbook

CarolynS

Board Regular
Joined
Oct 27, 2015
Messages
56
Hi

I'm trying to find some code that will pull data from one workbook to another without having to open the source data workbook. Currently, when my workbook "MTCR Tool" opens it asks if you would like to update the mapping data. If i click yes, I would like the mappings data to then be pulled in from the "Mappings" workbook. I know how to write the code to open the mappings workbook, copy and paste the data in to the MTCR Tool workbook and then close the mappings workbook but I remember hearing a while back that there is a way to do this without ever opening the mappings workbook? The mappings data I want to pull across is in columns A,C,D,E,F of the mappings workbook but the number of rows could vary.

I did find some code in another thread but it was using absolute references. I'm not sure how to handle the fact that I don't want to copy column B over and my row numbers may change?

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Everything I've ever read about this topic, as well as everything I've done similar, says that it's far, far easier to code open the foreign workbook, copy in needed things, close foreign workbook save:=false. You can even speed it up by turning off screenupdating and turning calculation to manual before you open/copy things (remember to reset scrnupdtg and calc at the end!).
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,115
Members
452,545
Latest member
boybenqn

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