Random Cell Value Display?

J

John V

I want a routine that will choose and display, in a significant-sized window
or form, a cell value (person's name) from a range of cells. Prior to the
final selection, I'd like the window or form to flash other randomly chosen
names, at first rapidly, then more slowly until it stops with the final
selection, similar to that experienced by a roulette wheel. Complementary
sound effects (wheel clicking) a bonus

Any thoughts? Or better, code? :) John
 
O

Office_Novice

Try Somthing like this in a Stanard Code Module

Sub RandomPicks()
Dim aRange As Range
Dim Lastrow As Long
Dim ws As Worksheet
Dim i As Variant
Dim x As Long
Set ws = ActiveWorkbook.Worksheets(1)
Lastrow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set aRange = Range("A1:A" & Lastrow)

Do Until x = 60
For Each i In aRange
x = x + 1
UserForm1.Label1.Caption = i
Application.Wait (Now + TimeSerial(0, 0, x / 5))
Next
DoEvents
Loop
End Sub

Add a label to a user form and call the pocedure with which ever event you
like.
 
O

Office_Novice

Redo....

Sub bbb()
Dim MyCell

MyCell = "A" & Int((100 * Rnd) + 1)

Do Until ActiveCell.Address(RowAbsolute:=False) = "$" & MyCell
ActiveCell.Offset(1, 0).Select
Loop

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top