dimanche 20 mars 2016

VBA code to get combobox value with conditions

I need to be able to generate random sample data based on my selection from the 2 comboboxes. I have (Person1,Person2,Person3) and (x1,x2,x3,x4,x5,x6)

Something like this is what i want to happen:

If i select person1 and x1 and click the button "click to generate sample data", i should get 4 random samples for all rows that has AA, 1 random sample for all rows that has BB, 1 random sample for all rows that has CC, 3 random samples for all rows that has DD, and 1 random sample for all rows that has EE.

I need help. Been asking question for half a month and no one seems to give me any answer. I have a lot of conditions (if else) to make and i don't have much idea on how to do it. I am trying to record a macro filtering data but i still need to get/copy data randomly and with a specific count in AA/BB/CC/DD




Aucun commentaire:

Enregistrer un commentaire