Importing dynamic worksheets from another workbook

jdarmin

New Member
Joined
May 22, 2019
Messages
2
Good morning everyone. Have a question.. Hope someone can help. I have a history with programming in QBASIC, but VB is... a different ballgame.

Here's what I'm trying to do at present. I am trying to marry several different workbooks for my work into one very powerful and highly automated workbook. So far it has been pretty successful but now I'm stumped.

What I need to accomplish:

I have two workbooks. One of them generates material usage projections (I'll call it "Projections"), and the other is essentially a ledger of balance, receipts, usae, ending balance - I'll call it "Planner." I want to keep these workbooks separate for now, but import data (via queries & conectins) from the Projections into the Planner.

(Once I get stuff imported, I think I can write simple scripts to interact with the data myself.)

So, I need a script (preferably with comments from the author - I'd really like to learn) that:

Checks the Projection workbook vs Planning workbook and reacts accordingly:
The tabs I need to import from Projections are identified by "Week of (whatever date - it is in MM-DD format)". There are generally 2-3 tabs like this in Projections.
--A. Is there any 'expired' data? For example if the script has previously imported "Week of 05-13" from Projections into Planning but that tab is no longer in Projections, close out the connection and delete the worksheet from Planning.
--B. Is there any 'new' data? If I have previously imported "Week of 05-20" but the Projections workbook now contains data for "Week of 05-27", create a new data connection/import that worksheet from Projections into Planning, with the worksheet in Planning having the same name ("Week of 05-27" in this case).

I've written a few other simple scripts for the Planning sheet but this one is different due to the dynamic nature of this operation.. and I'm a little stuck.

Thanks in advance..
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
And to clarify... I just essentially want the Planning sheet to have an imported copy of whatever "Week of MM-DD" tabs are in Projections. When old data drops out of Projections, it drops out of Planning too - when new data arrives, import it in. I hope this makes sense..
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
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