mardi 26 novembre 2019

Excel VBA Total 10% Random rows from a data but equally selected for each users

I want to create a macro to select 10% rows randomly from a data.

BUT there are 6 users so I want my sample to select equal rows for each user.

DATA: Staff 1 | 10 entries created in this month Staff 2 | 20 entries created in this month Staff 3 | 5 entries created in this month Staff 4 | 15 entries created in this month Staff 5 | 10 entries created in this month

Total entries created for a month = 60. I need 10% of sample - At least 12 random entries selected. This means, I need 3 random samples to be selected (and highlighted) for each Staff. (Max 15 samples)

OUTCOME: Staff 1 | Highlight 3 random entry created by Staff 1 Staff 2 | Highlight 3 random entry created by Staff 2 Staff 3 | Highlight 3 random entry created by Staff 3 Staff 4 | Highlight 3 random entry created by Staff 4 Staff 5 | Highlight 3 random entry created by Staff 5

I don't need to create another worksheet. Just want to Highlight the samples chosen on the same worksheet.

Please help!




Aucun commentaire:

Enregistrer un commentaire