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..
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..