Over the past few days I created a macro routine to copy/paste rows from different sheets to one master ToDo sheet based on date. There are three options: today's date, tomorrow's date, and special date (specified in a cell). I had it all working well within the code. I expected to have three different subs to run each type, feeding into the main block of code to do the work.
I kicked it up a notch by creating three buttons on the ToDo sheet for Today, Tomorrow, Special. I followed online articles (such as https://www.teachexcel.com/excel-tutorial/1893/pass-arguments-to-a-macro-called-from-a-button-or-sheet-in-excel) to add an argument named WhatDate to the MainControl sub and then to add the parameter to the AssignMacro of the buttons:
'MainControl "today"'
'MainControl "tomorrow"'
'MainControl "special"'
Everything worked great! I saved and closed out. Today, I need to make a tiny adjustment to the code. I can't find the vb code anywhere in the Microsoft Visual Basic for Applications window. How can I get back to my code?
I've read articles explaining why it doesn't show up in the Macros list and that makes sense - you can't run it without the argument. It must be "run" from the button. But certainly there's got to be a way edit, to get back to your code to continue developing - right? What am I missing?
---------------
So in talking this through with my wife (which, of course, I should have done first), I just had this idea that works:
Write a new macro that immitates the button. The only thing in it is:
'MainControl "today"'
Using F8 to step through the macro, it shows me the rest of my code.
Other than this workaround, any other/better way of doing it?