3 macros where macro 2 &3 depend on the results of macro 1

  • I have 3 macros that successfully massage a txt file every week to provide data in a particular format. Macro 1 produces a result and I name the resulting file (eg Jan 8,2020.xlsx). Macro 2 uses this file name to create a different .xlsx file (culmfile.xlsx) and it builds upon the cumulative data of previous weeks. The 3rd macro again uses the file name established by myself from the first macro to complete another .xlsx file (Culmdatabase) of cumulative data. I run these macros consecutively as macro 2&3 depend on the results from macro 1. In the first macro I manually use EDIT/REPLACE from the tool bar to insert the txt file name (Jan 8,2020.txt) into the code of the first macro. The second and third macros I manually use EDIT/Replace from the tool bar to insert the file name result from macro 1 (Jan 8, 2020.xlsx) into the code of each of macros 2 and 3 which allows them to update the cumulative files.

    Is there any code/Excel tool that will automatically replace pieces of information such as a filename in the actual macro code. IE code that performs the EDiT/Replace functionality on an existing macro code?


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!