MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 20th, 2002, 09:53 PM   #1
Qroozn
Board Regular
 
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
Default

A lady at work is running a sweep on a trifecta in Austalias biggest horse race.
There are 24 horses in the race.. and the prize is $5000. she is printing the tickets on normal paper and i'm worried about fraud.

We are printing out 1 of every possible combination, and selling every ticket. There are 12000+ combinations so hence 12,000+ tickets.

I want to keep a register of the ticket number... and its relative combination.

How can i create a list of each possible combination?

She is about to manually write all the tickets up. I'm hoping to get VBA to print the tickets for her (with the combinations, and the registration number)

[ This Message was edited by: Qroozn on 2002-05-20 20:57 ]
Qroozn is offline   Reply With Quote
Old May 21st, 2002, 12:13 AM   #2
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

I don't know anything about horse racing so I don't know how many horses are involved in each combination. If you could say how many horses would be involved in each ticket maybe I could help
Nimrod is offline   Reply With Quote
Old May 21st, 2002, 01:23 AM   #3
Rocky E
Board Regular
 
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
Default

Hi Q,
Well if you are going to print all 13,824 anyway buy same bright colored die cut sticker circles (I hope you have a fast laser printer) Priint one number and a nice graphic logo of you own design. If you get a good bright florecent it will drive color copiers nuts. We do inventory "dots" like this all the time. The one we use are about 8 accross and 10 down or 80 to the page. Should take less than 10 minutes.
__________________
Hope this helps!

Rocky

<h6>"Be not the first by whom the New are try'd,
Nor yet the last to lay the Old aside."
Alexander Pope (1688-1744).</h6>
Rocky E is offline   Reply With Quote
Old May 21st, 2002, 05:19 PM   #4
Qroozn
Board Regular
 
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
Default

Thanks guys.
Well there are 24 horses in the race. so that means the number of combinations is
24 x 23 x 22 = 12,144 possible combos.

1st thing first. how can i do script to put
A B C
1 1 2 3
2 1 2 4
3 1 2 5

etc up to
12144 24 23 22
Qroozn is offline   Reply With Quote
Old May 21st, 2002, 05:37 PM   #5
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-05-21 16:19, Qroozn wrote:
Thanks guys.
Well there are 24 horses in the race. so that means the number of combinations is
24 x 23 x 22 = 12,144 possible combos.

1st thing first. how can i do script to put
A B C
1 1 2 3
2 1 2 4
3 1 2 5

etc up to
12144 24 23 22
Correction! You are talking about permutations, not combinations. Your expected number is correct, just not your terminology.

If:
A1 has "1st place"
B1 has "2nd place"
C1 has "3rd place"

Run the following

Code:
Sub test()
Dim x As Integer, y As Integer, z As Integer, a As Long
Dim MyArray, Counter As Long

a = WorksheetFunction.Permut(24, 3)

ReDim MyArray(1 To a, 1 To 3)
For x = 1 To 24
    For y = 1 To 24
        For z = 1 To 24
            If x <> y And x <> z And y <> z Then
                Counter = Counter + 1
                MyArray(Counter, 1) = x
                MyArray(Counter, 2) = y
                MyArray(Counter, 3) = z
            End If
        Next z
    Next y
Next x
Range("A2").Resize(a, 3) = MyArray
End Sub
Bye,
Jay
Jay Petrulis is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes