The request is not clear. So you want the macro to run parts but not other parts? What is the determining factor(s) whether it runs which parts? Otherwise why not just comment it out with an ' apostrophe before that part of the code???
Thanks for the quick response (its me not detailing the query properly).
I am handing a dashboard onto a colleague who isn't confident with excel. (So ideally I wouldn't want them going into the vba and altering lines as they may alter the wrong bit)..
The dashboard updates monthly, and as part of the course I have a tiny sub in the workbook that OnWorkBookLoad, opens a tab called "Offline" that acts as a landing page while the dashboard is being updated.
This is manually turned on and off by commenting out the sub "mdl_offline".
My query was (as I am new to vba)....is it possible I can create a button so that when the dashboard is due for an update:
- the user clicks the offline button which removes the comment indicator ' from the "mdl_offline" sub.
- the user clicks the online button which adds the comment indicator ' to the "mdl_offline" sub.
Its not a clever sub in anyway and only controls the opening tab, so I am simply turning that sub off and on using comments to either land on landing page or not.
I hope that helps a bit.... I am not experienced with VBA so a lot of my coding is probably based on non-programmer logic which is probably different from the preferred vba logic.