mardi 29 mars 2016

VBA/Macro to get/copy random rows based on keywords

enter image description here

I need help to be able to get/copy random rows from another workbook with specific conditions:

source: rawdata.xlsx "Sheet1"

destination: tool.xlsm "Random Sample"

"AU", "FJ", "NC", "NZ", "SG12" are located in the first column (Column A). Attached screenshot shows how my rawdata.xlsx looks like.

If i click a button/run a macro, I should get 4 random rows for all rows that has "AU", 1 random row for all rows that has "FJ", 1 random row for all rows that has "NC", 3 random rows for all rows that has "NZ", and 1 random row for all rows that has "SG12" FROM rawdata.xlsx "Sheet1" and paste it to tool.xlsm "Random Sample".

All should happen in one click. It has been almost a month and i still got no luck being able to get answer to this question. I hope someone could help me out. Thanks.




Aucun commentaire:

Enregistrer un commentaire