Being a red-blooded lazy programmer, whenever I need to do something new with macros, I "record" it and then imitate the produced code. But oops, I can't cheat this time because what I want to do is export code to a .BAS ... you can't "record" actions in the VBA window (AFAIK).
What is the Excel VBA code to export to .BAS? Can it prompt me for destination, like you get from ActiveWorkbook.SaveAs? And most of all, can it dynamically loop through each module, or through each worksheet's code (which normally is nothing)? [i.e. something like For Each sheet... and maybe For Each module...?!]
For what it's worth, I wrote other macros which will join this new one as a text documenter - one saves all values; one saves all formulas; one saves all range definitions; and now this one would save all code. Feel free to suggest others. (The goal is something I can text compare; .BAS export code qualifies. Too bad the whole file isn't text, like VB.)
TIA. I hope I'm not asking for a lot here.
What is the Excel VBA code to export to .BAS? Can it prompt me for destination, like you get from ActiveWorkbook.SaveAs? And most of all, can it dynamically loop through each module, or through each worksheet's code (which normally is nothing)? [i.e. something like For Each sheet... and maybe For Each module...?!]
For what it's worth, I wrote other macros which will join this new one as a text documenter - one saves all values; one saves all formulas; one saves all range definitions; and now this one would save all code. Feel free to suggest others. (The goal is something I can text compare; .BAS export code qualifies. Too bad the whole file isn't text, like VB.)
TIA. I hope I'm not asking for a lot here.