I have currently 4 models I use to import the data from an excel spreadsheet and manipulate them. The source data come in two templates and two types. Therefore 4 models to cover each option. One of the types also has two subtypes.
So I've been thinking about merging the four models into one and use a user form to determine the options. I just wonder what would be the best way to do it. Because basically I will have 6 options.
The model is not too sophisticated but has a fair amount of code. It works as follows. Let's assume that there two templates: ABC and XYZ, two types: External and Internal and the Internal type has also two tiers: Tier 1 and Tier 2.
The model is a spreadsheet with a few worksheets, which present the data in the way I need. All the data are linked to one or two worksheets I import from a source workbook. As the source worksheets are not present at the beginning, all formulas in the resulted worksheets are commented.
So when a user runs the model, it opens the source workbook, copies the necessary worksheets into the model, saves the file under a new name, uncomments the formulas in the worksheets, which present the data in a particular way, does some necessary formatting, removes conditional formatting and saves the file again.
The two templates are quite similar but different enough to have slightly different code, though some chunks of the code are the same.
So I've been thinking I can do it two ways. I can copy main macros for each option and have an IF structure to decide which o ne to run depending on the choice of options in the user form. Some worksheets are different depending on the template, so I will have to delete those I do not need and rename the ones I need.
Alternatively, I can merge the code in one macro and run the chunks of the code depending on the choice in the user form.
I just do not know which is the more efficient way of doing it?
So I've been thinking about merging the four models into one and use a user form to determine the options. I just wonder what would be the best way to do it. Because basically I will have 6 options.
The model is not too sophisticated but has a fair amount of code. It works as follows. Let's assume that there two templates: ABC and XYZ, two types: External and Internal and the Internal type has also two tiers: Tier 1 and Tier 2.
The model is a spreadsheet with a few worksheets, which present the data in the way I need. All the data are linked to one or two worksheets I import from a source workbook. As the source worksheets are not present at the beginning, all formulas in the resulted worksheets are commented.
So when a user runs the model, it opens the source workbook, copies the necessary worksheets into the model, saves the file under a new name, uncomments the formulas in the worksheets, which present the data in a particular way, does some necessary formatting, removes conditional formatting and saves the file again.
The two templates are quite similar but different enough to have slightly different code, though some chunks of the code are the same.
So I've been thinking I can do it two ways. I can copy main macros for each option and have an IF structure to decide which o ne to run depending on the choice of options in the user form. Some worksheets are different depending on the template, so I will have to delete those I do not need and rename the ones I need.
Alternatively, I can merge the code in one macro and run the chunks of the code depending on the choice in the user form.
I just do not know which is the more efficient way of doing it?