VBA help needed

  • Hi Experts,

    I would like to request your help for a vba code which should randomly pick rows from designed worksheet and add them to a new sheet (or individual sheets if filtering it's an option). I am attaching a workbook with dummy data, hopefully someone can help me with a method.

    Data sheet will always have the employee on column A, and the helper column on the last row. (I've created the helper column since it's unique and I thought it would help)

    Rows with data should be randomly picked from the "Data" sheet based of criteria announced on "CRIT" worksheet from the same workbook.

    For each individual employee(column "A") a fixed number of rows will need to be extracted (randomly) as indicated in "CRIT" sheet (The Max Rows Of UniqueID).

    And here comes the twist: The UNIQUEID(helper column) it's composed of 2 separate processes and there's a Max Number for each of them also. (For example if we have 7 rows extracted, we won't have just 7 randoms, but would have 5 and 2 or 4, 2, 1 based of the numbers in the "CRIT" sheet, which are listed also)

    There's also an importance which marks which "process"( Data E vs. Data F) should be more present in the final picks.

    Another important aspect I can think of relates to when isn't enough data to perform the above distribution. Maybe an error should occur pointing it out, asking to verify "Data" sheet?

    I have read about different methods like scripting dictionary & filters but I can't seem to compile anything.

    Your work & time will be greatly appreciated!

    Let me know if this is doable and if I can be of any help!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!