Go Back   Access World Forums > Apps and Windows > Excel

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-31-2017, 07:26 PM   #1
BobNTN
Newly Registered User
 
Join Date: Jan 2008
Location: Tenn
Posts: 290
Thanks: 4
Thanked 0 Times in 0 Posts
BobNTN is on a distinguished road
Pairing selection

Wondering if this is possible in Excel.
I have 40 golfers.
Want to randomly pair them (2 man teams) each day for 3 days but without repeat pairs.
If possible can someone put me on the right track ?

Thanks

BobNTN is offline   Reply With Quote
Old 07-31-2017, 09:34 PM   #2
arnelgp
Newly Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 4,986
Thanks: 50
Thanked 1,661 Times in 1,582 Posts
arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough
Re: Pairing selection

Please find the attached xlsm file.
There are twi sheets, sheet1 holds the name of the golfers. The reults will be shwon on sheet2.
To view the vba press alt-f11. Click inside generatepair sub then preas f5 to run.
Attached Files
File Type: zip golfers.zip (16.1 KB, 16 views)
__________________
"Never stop learning, because life never stops teaching"

Last edited by arnelgp; 08-01-2017 at 08:13 PM.
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
BobNTN (08-02-2017)
Old 08-01-2017, 09:27 AM   #3
BobNTN
Newly Registered User
 
Join Date: Jan 2008
Location: Tenn
Posts: 290
Thanks: 4
Thanked 0 Times in 0 Posts
BobNTN is on a distinguished road
Re: Pairing selection

No attachment

BobNTN is offline   Reply With Quote
Old 08-02-2017, 09:57 AM   #4
BobNTN
Newly Registered User
 
Join Date: Jan 2008
Location: Tenn
Posts: 290
Thanks: 4
Thanked 0 Times in 0 Posts
BobNTN is on a distinguished road
Re: Pairing selection

Seems I have totally screwed up in explaining what I am trying to do.
I have a yearly tournament that has anywhere from 36 upwards to 50 players. The regular 3 day tournament is a 2 man team where the same 2 players play together all 3 days.

I am trying to add a 'side' tournament where each player would be paired with a different partner each of the 3 days and of course, separate scoring method for that side tournament.
So, hopefully I can get it right this time.
example - Players 1 and 2 are partners for all 3 days for the main tournament.
Also in the side tournament, player 1 would be paired with one of the other, in this instance, 38 players for the first day, 1 of the 37 players the second day, and one of the 36 players the third day.
So he would never be paired with his normal partner in the side tournament and would never have the same partner any two days.
I would assume in your code, if the total number of players changed to, say, 46, I would need to change the "for j = 1 to 40" statement to 1 to 46 ?
Also is there a way to add a button to run the macro ?
Thank you so much and I humbly apologize for not explaining it all.
BobNTN is offline   Reply With Quote
Old 08-03-2017, 04:52 AM   #5
arnelgp
Newly Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 4,986
Thanks: 50
Thanked 1,661 Times in 1,582 Posts
arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough
Re: Pairing selection

sorry for the late reply.
you had me thinking there.
on the attached sample, you will manually put the pairs (regular tourney) to sheet1.
for side tourney, go to sheet2 and click the command button.
the code is not optimised, so be patient with the result.
Attached Files
File Type: zip golfers.zip (25.9 KB, 18 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-03-2017, 05:58 AM   #6
BobNTN
Newly Registered User
 
Join Date: Jan 2008
Location: Tenn
Posts: 290
Thanks: 4
Thanked 0 Times in 0 Posts
BobNTN is on a distinguished road
Re: Pairing selection

That appears to work great.
Wish I understood all that.

Thank you so much.
BobNTN is offline   Reply With Quote
Old 08-03-2017, 06:12 AM   #7
BobNTN
Newly Registered User
 
Join Date: Jan 2008
Location: Tenn
Posts: 290
Thanks: 4
Thanked 0 Times in 0 Posts
BobNTN is on a distinguished road
Re: Pairing selection

One more question.
I have a file with 10 or 12 worksheets that I run off of one sheet with names on it, handicaps, etc.
Is there a way I can copy this into that workbook as additional worksheets and still maintain the code ? That way I can use my main player list for it to run from.


BobNTN is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] combobox selection list not updating after each selection Twinnie Forms 4 10-31-2014 02:06 AM
Selection Rulers - Click Drag and Select Controls in selection area (EXAMPLE) BlueIshDan Modules & VBA 0 05-28-2014 09:24 AM
Pairing non-similar rows David_P Modules & VBA 14 10-05-2010 11:56 AM
Pairing seperate columns of information in access. no cigar Tables 0 02-02-2010 02:18 PM
Multiple Selection List Box on Form & saving selection delilah84au Forms 0 10-08-2006 10:45 PM




All times are GMT -8. The time now is 03:15 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World