+ Reply to Thread
Results 1 to 5 of 5

Help create code to pair like items at random

Hybrid View

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2011 OSX, 2010, 2007, & 2003
    Posts
    4

    Red face Help create code to pair like items at random

    Hello and thank you to anyone that can try to help me.

    I have some experience with excel and consider myself a little above an average user, but I have never really programmed macros/vba before.

    What I am trying to do is create a list that will pair two dogs at random, but they need to be within 3 lbs of each other, not from the same owner, and they can only be shown once. Each owner will have between 1-3 dogs to show and there could be up to 20 owners per show.

    I have included a quickly thrown together example of what I am trying to do. I locked it because I only want to allow entry into columns C, D, & I, but there are no passwords so you can remove it to make changes.

    If possible I would like a macro/vba button to calculate column I after I manually enter C and D and a second button to clear columns C, D, & I after I have the results so I can do it again.

    I hope this was all clear enough, thanks again to anyone who will help me.

    Scott Adams
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2011 OSX, 2010, 2007, & 2003
    Posts
    4

    Re: Help create code to pair like items at random

    Can anybody give me any ideas at all?

  3. #3
    Registered User
    Join Date
    01-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2011 OSX, 2010, 2007, & 2003
    Posts
    4

    Re: Help create code to pair like items at random

    One more try.... Please!?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help create code to pair like items at random

    I don't have a VBA suggestion, but think you could do this manually if you simplify the layout.

    Sort the dogs descending by weight. Start with the heaviest dog and pair with the next heaviest having a different owner. Conditional formatting shows remaining dogs available for selection.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    01-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2011 OSX, 2010, 2007, & 2003
    Posts
    4

    Re: Help create code to pair like items at random

    Thanks for the help, but I am trying to make it extremely easy to use. The people that will be using this do not understand excel, so I just want them to enter the weights, press a button, and then print.
    Last edited by SAFD1450; 01-30-2011 at 01:22 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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