D
Duncan
Hi all,
I know this has been covered all over with various topics but im not
sure that it fits my purpose, basically I want to select one of my 600
cells to put the value in a textbox, and randomly. But I dont want any
duplicates, so want to cycle through my values at random without
showing the same one twice, and when/if all 600 have been displayed
just to start again from the beginning.
at the moment I have:
Private Sub Thons_Click()
Randomize
Dim MyValue, MyString
A:
MyValue = Int((600 * Rnd) + 1)
MyString = Range("E" & MyValue)
If MyString = "" Then GoTo A
tbMessage.Text = MyString
End Sub
I have to put the Goto A in there because some cells in the column are
blank, and dont want to display those.
Any ideas how I can achieve this without duplicates popping up? mainly
because sometimes the first 10 displayed repeat and then you are not
sure if you have seen them all.
Any help would be much appreciated.
Many thanks
Duncan
I know this has been covered all over with various topics but im not
sure that it fits my purpose, basically I want to select one of my 600
cells to put the value in a textbox, and randomly. But I dont want any
duplicates, so want to cycle through my values at random without
showing the same one twice, and when/if all 600 have been displayed
just to start again from the beginning.
at the moment I have:
Private Sub Thons_Click()
Randomize
Dim MyValue, MyString
A:
MyValue = Int((600 * Rnd) + 1)
MyString = Range("E" & MyValue)
If MyString = "" Then GoTo A
tbMessage.Text = MyString
End Sub
I have to put the Goto A in there because some cells in the column are
blank, and dont want to display those.
Any ideas how I can achieve this without duplicates popping up? mainly
because sometimes the first 10 displayed repeat and then you are not
sure if you have seen them all.
Any help would be much appreciated.
Many thanks
Duncan