Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Random select of text
Hi,
I have a list of questions, which I want to be selected on another sheet at random, the range is Sheet1!A1:A10 and when I run a command, I wish to have one of the questions from the selected range chosen at random. ie. [very simplistic example] Sheet 1 A1 = What colour is grass? A2 = What colour is the sky? Sheet 2 A1 contains the result of this function and is calculated when the function is called by a command button. I hope this all makes sense? Thanking you all in advance. Cheers Tanya |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Random select of text
you could paste this macro into a vba module and assign it to a forms button
on the worksheet Sub Test() Dim lngRandom As Long Randomize lngRandom = Int((10 * Rnd) + 1) Range("A1").Value = Worksheets("Sheet1").Range("A" & lngRandom) End Sub "Tanya" wrote: Hi, I have a list of questions, which I want to be selected on another sheet at random, the range is Sheet1!A1:A10 and when I run a command, I wish to have one of the questions from the selected range chosen at random. ie. [very simplistic example] Sheet 1 A1 = What colour is grass? A2 = What colour is the sky? Sheet 2 A1 contains the result of this function and is calculated when the function is called by a command button. I hope this all makes sense? Thanking you all in advance. Cheers Tanya |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Random select of text
Thank you JMB,
works great! cheers Tanya "JMB" wrote: you could paste this macro into a vba module and assign it to a forms button on the worksheet Sub Test() Dim lngRandom As Long Randomize lngRandom = Int((10 * Rnd) + 1) Range("A1").Value = Worksheets("Sheet1").Range("A" & lngRandom) End Sub "Tanya" wrote: Hi, I have a list of questions, which I want to be selected on another sheet at random, the range is Sheet1!A1:A10 and when I run a command, I wish to have one of the questions from the selected range chosen at random. ie. [very simplistic example] Sheet 1 A1 = What colour is grass? A2 = What colour is the sky? Sheet 2 A1 contains the result of this function and is calculated when the function is called by a command button. I hope this all makes sense? Thanking you all in advance. Cheers Tanya |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Random select of text
glad to hear it worked for you - thanks for the feedback
"Tanya" wrote: Thank you JMB, works great! cheers Tanya "JMB" wrote: you could paste this macro into a vba module and assign it to a forms button on the worksheet Sub Test() Dim lngRandom As Long Randomize lngRandom = Int((10 * Rnd) + 1) Range("A1").Value = Worksheets("Sheet1").Range("A" & lngRandom) End Sub "Tanya" wrote: Hi, I have a list of questions, which I want to be selected on another sheet at random, the range is Sheet1!A1:A10 and when I run a command, I wish to have one of the questions from the selected range chosen at random. ie. [very simplistic example] Sheet 1 A1 = What colour is grass? A2 = What colour is the sky? Sheet 2 A1 contains the result of this function and is calculated when the function is called by a command button. I hope this all makes sense? Thanking you all in advance. Cheers Tanya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get Excel to select a random entry for me? | Excel Discussion (Misc queries) | |||
select random value in a range of cells | Excel Discussion (Misc queries) | |||
Select a random sample | Excel Discussion (Misc queries) | |||
Random select entries | Excel Discussion (Misc queries) | |||
Select random cell | Excel Worksheet Functions |