Create a link to another workbook via form control

CaptainGravyBum

Board Regular
Joined
Dec 1, 2023
Messages
77
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have a user who has created a workbook for each week number of the year and would like portions of the data in that workbook to be populated from another workbook that has already been created. Both workbooks will change name each week, which makes it hard to link them, so I have played with the idea of using the data in a cell to specify which workbook to open before copying the data across, but it could be hard work because the source folder will change as well.
I'm now thinking that it may be easier to have a 'browse' button at the top of the destination workbook so the user can simply browse to the required file and create a workbook link.

Sorry, I'm struggling to find a logical way to explain what I need.

Can anyone decipher my needs and suggest a solution? Or a completely different way to accomplish this that I haven't thought of.

Thanks,
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I suggest that your button should run code that opens the msoFileDialogFilePicker. I think Excel has another method named GetOpenFileName but I'm not too familiar with it. AFAIK, either one should return the complete path. The Excel version might have file name as a property but I can't recall. The picker doesn't so you get the filename by extracting what comes after the last "\". I would have to look at old code in both apps to verify, but you could Google both methods and see what you think.

With the picker, you can start with any valid folder name (the property is called InitialFileName) which might come in handy if folders are being added or moved around slightly. You might even put the last starting point in a helper cell if it turns out you'll always want to start from there. Sorry I can't be more explicit at the moment.
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,088
Members
453,021
Latest member
Justyna P

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