random text

M

mickytech

here goes
randomize either name to team or team to name
list of football teams 40
list of names 40
command button 1
press command button so that a name will match up to a team , but never
duplicate until reset, use the a1:a40 cells and b1:b40 cells

hope i have made it clear for all you people
good luck and many thanks

example

A B
1 bob billingham
2 dave hartlepool
3 john redcar

after click on command button to randomize team or name

A B
1 bob hartlepool
2 dave redcar
3 john billingham
 
T

Tom Ogilvy

Sub CommandButton1_Click()
range("C1:C40").Formula = "=rand()"
Range("B1:C40").Sort Key1:=Range("C1")
Range("C1:C40").ClearContents
End Sub
 
S

Soo Cheon Jheong

Hi,

-------------------------------------------------
Sub TEST_1()
With Range("C1:C40")
.Formula = "=RAND()"
Range("B1:C40").Sort Key1:=.Cells(1)
.ClearContents
End With
End Sub
-------------------------------------------------

-------------------------------------------------
Sub TEST_2()
With Range("B1:C40")
.Columns(2).Formula = "=RAND()"
.Sort Key1:=.Cells(1, 2)
.Columns(2).ClearContents
End With
End Sub
-------------------------------------------------


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 
Top