Randomize rows
Robb,
You could randomly pick the data and display it using a macro. Assign the macro below to your
button. The macro was written assuming your data table of values (not formulas) starts in cell A1,
with headers in row 1, and no blank rows within your table.
HTH,
Bernie
MS Excel MVP
Sub ShowRandomValue()
Dim myRow As Integer
Dim myCount As Integer
Dim i As Integer
Dim myStr As String
myStr = ""
myCount = Range("A:A").SpecialCells(xlCellTypeConstants).Cel ls.Count - 1
Randomize
myRow = Application.RoundUp(Rnd() * myCount, 0) + 1
For i = 1 To Range("A1").CurrentRegion.Columns.Count
myStr = myStr & " " & Cells(myRow, i).Value
Next i
MsgBox myStr
End Sub
"Robb Quirk" wrote in message
...
I need to be able to randomize a set of data upon clicking a button. Each
set of data consists of three or four cells in one row, and can have numbers
or letters in it. The purpose of this is similar to pulling a name out of a
hat for a raffle drawing. Any ideas? Thanks in advance.
|