+ Reply to Thread
Results 1 to 11 of 11

Random selection of rows

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Random selection of rows

    http://www.excelforum.com/excel-prog...o-another.html

    Hello All,

    I'm still looking for help with the thread above. I need "Validation Worksheet" to always include the results of the autofilter of "checklog" and then make unique, random choices from "checklog" until "D3" is reached. See Sub RANDOM() .

    With the attached, there needs to be 6 records selected (5% of 114), with one mandatory item to review (in green on "checklog").
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    I've worked out how to include my older inventory items in the Validation worksheet. Can anyone help me with the coding to prevent duplicate Entry Numbers when each CTR runs in sub Random() below?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Hoosaskin; 11-18-2011 at 06:27 PM. Reason: Added newest workbook

  3. #3
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Any thoughts?

  4. #4
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Still looking to prevent repeated ENTRY NUMBERS on the Validation Worksheet tab. They are unique on the checklog tab.

  5. #5
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    How can I prevent duplicates from checklog, column A on Validation Worksheet, column B?

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Random selection of rows

    Hello Hoosaskin,

    I have tried to replicate the duplicates you are referring to, without success. Try to change your code as posted with the lines in red, and see if that solves your problem.

    Please Login or Register  to view this content.
    Hope that helps!

  7. #7
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Winon,
    Since the sub is only looking for 6 items of 114, it could be that after copying the 4 auto filtered ones it didn't select a duplicate. Eventually it will choose one of the previously selected 4 items. How can I code this piece to look at the ones already chosen and move on if there's a match?

  8. #8
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Would anyone like a weekend project? I'm sure it will involve creating an array of the selected rows (auto-filtered first, then CTR). I just don't know how to code sub RANDOM() so there are not duplicate entry numbers on the Validation worksheet
    Last edited by Hoosaskin; 01-13-2012 at 06:32 PM.

  9. #9
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Here is a new set of raw data with a larger sampling required, and my latest version of the workbook. Duplicate selections of entry numbers, via sub random(), should be easier to cause. There should be 19 rows copied to the validation worksheet by the auto filter, and another 19 by the CTR function. How can I stop the CTR function from choosing any of the previously copied rows?
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Anyone???? Please!

  11. #11
    Registered User
    Join Date
    08-18-2011
    Location
    Denver Colorado
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Random selection of rows

    Can anyone help me figure this out?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1