Azza87
New Member
Hello,
I am trying to write a VBA macro/code that allows me to generate a list of 100 companies to use for a survey based on a certain parameter "Size_Category". There are 3 categories and each of the categories have an identified a sample size required to be included in the final survey population of 20 companies.
Because I want to ensure that the survey population that is selected is not objective, I added a random number. I thought of recording a macro using the methodology that I have defined below:
1) Generate random number for the company list.
2) Filter list based on Size_Category
3) Sort list based on Random #
4) Copy number of companies based on the population number required
5) Repeat steps 2 to 4 for the other size_categories
However, I fear that by resorting to this methodology I might be a bit restricted, and the macro will be a little bit clunky and confusing to edit.
Any ideas on how I can setup a vba code to facilitate this process? I attached a file with a sample list to put things into context.
Many thanks!
Azza
I am trying to write a VBA macro/code that allows me to generate a list of 100 companies to use for a survey based on a certain parameter "Size_Category". There are 3 categories and each of the categories have an identified a sample size required to be included in the final survey population of 20 companies.
Because I want to ensure that the survey population that is selected is not objective, I added a random number. I thought of recording a macro using the methodology that I have defined below:
1) Generate random number for the company list.
2) Filter list based on Size_Category
3) Sort list based on Random #
4) Copy number of companies based on the population number required
5) Repeat steps 2 to 4 for the other size_categories
However, I fear that by resorting to this methodology I might be a bit restricted, and the macro will be a little bit clunky and confusing to edit.
Any ideas on how I can setup a vba code to facilitate this process? I attached a file with a sample list to put things into context.
Many thanks!
Azza