I have a few models which do the same thing but for different sets of data. I am thinking to merge them into one model where a user will have to select a type of the data in order to run either a corresponding sub or a corresponding piece of code in the main sub.
Background: the existing models import data from a spreadsheet generated by a different application. There are two types of the data , which could be presented in two different templates. Also one data type has two subtypes. Also there is an option to replace conditional formatting in the resulted spreadsheet with normal (two avoid issues). So there are currently 4 models and six combinations of the data.
The combined model will have user form controls which will allow a user to select what data type combination they import.
So I first created a userform, which is activated by pressing a button on the spreadsheet. Then I thought that the button redundant. So I am now thinking how to get rid of the button.
I can either use form controls just on the first worksheet of the model. The only issue with it that I have changed the text on each of them and now it's a bit difficult to find their names to refer to in a macro. In the userform on the other hand you can change the names of the controls to something relevant, which makes it much easier to use and change/check the code if necessary. So to bring up the userform I used
But then I thought, if a user would like to unload the userform, they will have to close and reopen the model to re-initialise it. I can put a button to re-initialise it but it will defy the whole reason to remove it.
SO I wonder what is the best way to deal with this situation.
Background: the existing models import data from a spreadsheet generated by a different application. There are two types of the data , which could be presented in two different templates. Also one data type has two subtypes. Also there is an option to replace conditional formatting in the resulted spreadsheet with normal (two avoid issues). So there are currently 4 models and six combinations of the data.
The combined model will have user form controls which will allow a user to select what data type combination they import.
So I first created a userform, which is activated by pressing a button on the spreadsheet. Then I thought that the button redundant. So I am now thinking how to get rid of the button.
I can either use form controls just on the first worksheet of the model. The only issue with it that I have changed the text on each of them and now it's a bit difficult to find their names to refer to in a macro. In the userform on the other hand you can change the names of the controls to something relevant, which makes it much easier to use and change/check the code if necessary. So to bring up the userform I used
VBA Code:
Private Sub Workbook_Open()
UserForm1.Show
End Sub
But then I thought, if a user would like to unload the userform, they will have to close and reopen the model to re-initialise it. I can put a button to re-initialise it but it will defy the whole reason to remove it.
SO I wonder what is the best way to deal with this situation.