Retrive Data from another workbook.

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Retrive Data from another workbook.

Post by adam »

The code posted at Post=8982 retrieves data from the worksheet assigned in the code from the active workbook.

If this code is to be changed so that it retrieves data from the worksheet "OrderData" in the workbook at location D:\Customer\Bills.xlsx

How may I do so?

Should it be same as at Post=19565

Any suggestion on this would be kindly appreciated.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78527
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Retrive Data from another workbook.

Post by HansV »

Yes, you will have to open the Bills.xlsx workbook in order to retrieve data from it.

But be careful: the Worksheet_Change event will occur each time the user changes a cell, so opening and closing the workbook each time might have a noticeable negative effect on performance.
It might be better to keep the other workbook open.
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Retrive Data from another workbook.

Post by adam »

Thanks for the reply Hans. I'll try to figure this out.
Best Regards,
Adam