Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
In Excel How Do I Random a Number but Not when it recalculates?
I am trying to make a Macro that will select a few cells and random number
between 1-100 (I have done this). But when I use =RANDBETWEEN(1,100) whenever I change a number in my cells it randoms. I was wondering whether there was a =random that doesnt do after every recalculate. Or a Macro term. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
In Excel How Do I Random a Number but Not when it recalculates?
Why not just paste in the value after you use the formula? I believe
all of the random functions (RAND, etc) are volatile. HTH, JP On Feb 27, 4:56*pm, TxcPhtm wrote: I am trying to make a Macro that will select a few cells and random number between 1-100 (I have done this). But when I use =RANDBETWEEN(1,100) whenever I change a number in my cells it randoms. I was wondering whether there was a =random that doesnt do after every recalculate. Or a Macro term. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
In Excel How Do I Random a Number but Not when it recalculates
Thats not what I meant I mean so when i click a button they change
|
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
In Excel How Do I Random a Number but Not when it recalculates
Press the F9 button.
TxcPhtm wrote: Thats not what I meant I mean so when i click a button they change |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
In Excel How Do I Random a Number but Not when it recalculates?
On Feb 27, 1:56*pm, TxcPhtm wrote:
I am trying to make a Macro that will select a few cells and random number between 1-100 (I have done this). But when I use =RANDBETWEEN(1,100) whenever I change a number in my cells it randoms. I was wondering whether there was a =random that doesnt do after every recalculate. Or a Macro term. I am a little confused. On the one hand, you say are "trying to make" a macro that does this; on the other hand, you say you are using =RANDBETWEEN(1,100), presumably in an Excel cell. Moreover, you say that "a macro" will select a few cells. Usually, you select the cells, then execute a macro to operate on the selected cells. (Although, of course, you can indeed write the macro so that it makes the selection.) Be that as it may, you might be able to accomplish your task (whatever that is) by computing the random number(s) within the macro. In Excel 2007, you might be able to use WorkSheetFunction.Randbetween, since I believe the RANDBETWEEN() is now a standard Excel function. I don't know; I cannot do that in Excel 2003. Alternatively, you can write your own function, namely: Function myRandBetween(low As Long, high As Long) As Long myrandbetween = low + Int((high - low + 1) * Rnd()) End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
whole workbook recalculates when I change a cell | Excel Discussion (Misc queries) | |||
In excel, I want to generate a random number | Excel Discussion (Misc queries) | |||
Excel recalculates on startup? | Excel Worksheet Functions | |||
Excel random number | Excel Discussion (Misc queries) | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) |