Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting players of cards

put 1 to 80 in A1:A80

in B1 to B80 put in

=Rand()

then sort both columns with column B as the sort key.

now you can take the firs "n" cells.

Regards,
Tom Ogilvy


"Pit" wrote in message
...
I have to draw some numbers from 1 to 80,i need to put a
form of application numbers, putting them to couples, they
are not had to repeat in the cycle of the program
Kindest regards
Peter



  #2   Report Post  
Posted to microsoft.public.excel.programming
Pit Pit is offline
external usenet poster
 
Posts: 1
Default Sorting players of cards


-----Original Message-----
put 1 to 80 in A1:A80

in B1 to B80 put in

=Rand()

then sort both columns with column B as the sort key.

now you can take the firs "n" cells.

Regards,
Tom Ogilvy


Ok but i need a random beetwen 1 to 80, any vba code?
Thanks in advance
Pit
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting players of cards

That gives you a random between 1 and 80

Sub tester3()
Range("A1").Value = 1
Range("A2").Value = 2
Range("A1:A2").AutoFill _
Destination:=Range("A1:A80"), _
Type:=xlFillDefault
Range("B1:B80").Formula = "=Rand()"
Range("A1:B80").Sort Key1:=Range("B1")
varr = Range("A1:A10")
For i = 1 To 10
sStr = sStr & varr(i, 1) & ", "
Next
sStr = Left(sStr, Len(sStr) - 2)
' range("A1:B80").ClearContents
MsgBox sStr
End Sub

gives you 10 random picks.

--
Regards,
Tom Ogilvy


"Pit" wrote in message
...

-----Original Message-----
put 1 to 80 in A1:A80

in B1 to B80 put in

=Rand()

then sort both columns with column B as the sort key.

now you can take the firs "n" cells.

Regards,
Tom Ogilvy


Ok but i need a random beetwen 1 to 80, any vba code?
Thanks in advance
Pit



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
golf league mixing players SugarbushJim Excel Discussion (Misc queries) 2 November 10th 08 06:34 PM
Ranking of players Tommy Excel Discussion (Misc queries) 1 April 5th 06 06:26 PM
How would I pick random team players using a 1 to 5 rating sys? irish257 Excel Worksheet Functions 3 March 22nd 06 09:44 PM
how can you set it up for more players on the bracket tracker? bracket question Charts and Charting in Excel 0 March 13th 06 08:10 PM
How do I set up a Doubles Tennis roster for 12 players? AliJax New Users to Excel 3 September 17th 05 12:31 AM


All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"