Activating Open Workbook and Sheet using multiple Wildcards

vmschmidt

New Member
Joined
Jul 15, 2016
Messages
1
Hello all. Complete somewhat self-taught newbie here (so sorry in advance).

I have a macro that gives the user an option to copy data from EITHER a workbook (already) run once in the morning titled "YY-MM-DD BBC_Dispatch1.xlsx" opened from a folder, -OR- copy the report from a just-run workbook (if they wanted updated data in the afternoon) reporting live data titled "BBC_Dispatch1.xlsx". Either one of these workbooks will be open when the macro is run, NEITHER of them will be open at the same time.

In addition, I want to negate an issue where, when the live report is run for the first time, it is called "BBC_Dispatch1" however if run multiple times, the title changes from Dispatch1 to 2 or 3 (that is another macro I have no control over). So one of these reports could be titled "BBC_Dispatch4.xlsx".

The tab I want activated on both is called "tblDispatch", both Sheet3.

I have the code to activate JUST the "BBC_Dispatch1.xlsx" workbook and tab and it works just fine, but I want it to be easier on the user to pull from either source. Is there a way to Activate either worksheet (remember they will NOT be open at the same time) using multiple wildcards similar to what they would both have in common: "*BC_Dispatch*.xlsx", where the first * could be the date and the first B in one workbook, or just the first B in the other workbook; the second wildcard would represent the 1, 2, 3, etc? And then also activate the "tblDispatch" tab?

I just need to Activate, I have the rest of the copy/paste/formatting/pivot part working.
Thank you,
v.
 

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