View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Generate a random result...


this could work:

in sheet2
A1:A5
john
jason
dave
george
leo
B1:B5
=RAND()
=RAND()
=RAND()
=RAND()
=RAND()


copy this macro to a module
Sub Macro1()
'
Application.ScreenUpdating = False
Sheets("Sheet2").Select
Range("A1:B5").Select

Selection.Sort Key1:=Range("B1"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Sheets("Sheet1").Select
Range("C2").Select
End Sub

Go to sheet1
create a button using forms
assign this macro to a button

now in sheet1 A1 enter this :
=Sheet2!A1

click on the button to get random names


--
davesexcel


------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=537623