Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Selecting the value from a randomly selected cell out of a range
I am trying to select a value from a randomly selected cell out of a range of
values in a column to use in a formula in a second column. I can't seem to find a way to do this? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Selecting the value from a randomly selected cell out of a range
Try this... It will randomly pick a cell from the selected cells. The
first is a macro, the second is a worksheet function. Option Explicit Sub choose_random_cell_from_selection() Dim MyValue Randomize ' Initialize random-number generator. MyValue = Int((Selection.Count * Rnd) + 1) ' Generate random value between 1 and 6. MsgBox Selection(MyValue) End Sub Function choose_random_cell(selected_range As Range) Dim MyValue Randomize ' Initialize random-number generator. MyValue = Int((selected_range.Count * Rnd) + 1) ' Generate random value between 1 and 6. choose_random_cell = selected_range(MyValue) End Function On Jun 3, 12:58 pm, Steve W. <Steve wrote: I am trying to select a value from a randomly selected cell out of a range of values in a column to use in a formula in a second column. I can't seem to find a way to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to sort a column of Randomly selected numbers? | Excel Worksheet Functions | |||
Selecting the first non blank cell in Range | Excel Worksheet Functions | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
How to generate a list of randomly selected numbers within a range | Excel Worksheet Functions | |||
Selecting a cell in a range | Excel Worksheet Functions |