Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get Excel to select a random entry for me? Solitaire Excel Discussion (Misc queries) 7 January 15th 08 03:55 PM
select random value in a range of cells Pete Morris Excel Discussion (Misc queries) 4 March 30th 07 09:26 PM
Select a random sample IPMS Excel Discussion (Misc queries) 2 January 7th 07 02:54 AM
Random select entries brodiemac Excel Discussion (Misc queries) 2 September 9th 06 03:01 AM
Select random cell SammyJJones Excel Worksheet Functions 4 November 11th 05 01:56 AM


All times are GMT +1. The time now is 02:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"