A macro to add a Workbook_Open() sub to multiple workbooks

Petijandro

New Member
Joined
Feb 6, 2013
Messages
12
Hello Dear Excel Gurus!

Just to provide some context for you:
I've put together a tracking workbook which is used by many colleagues (everybody has their own) and they track their workhours inside the workbooks. Upon each work entry you need to select an item from a list (I used data validation for this) and another item which is dependent on the first choice (So if the first chosen item was "A" then they can only choose "A1", "A2".. but if they chose "B" then "B1", "B2" and so on.. - I used the name manager to allow sublists).
The database where the data for these lists are pulled from reside inside every workbook and it is very tedious to update each and every one of them and then update the name manager so the data refreshes in the lists.
So I'd like to have an external xls to have the database and then have all the workbooks refresh their datasets (and the name manager) upon workbook opening.

Is it possible to put together an updater to loop through the workbooks and add some code in the "ThisWorkbook" module so it opens the database file, copies the data into its own list and refreshes the name manager (I can do the latter part, but not sure about the first one)?

Thank you for every insights! (attached a gif of how the lists work)
 

Attachments

  • jLrV1nMJA1.gif
    jLrV1nMJA1.gif
    79.1 KB · Views: 5

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,175,794
Messages
5,899,535
Members
434,780
Latest member
andreeajc

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
Top