random numbers

G

Guest

I'm running a macro which(using a For Loop), inputs the results from certain
calculations into a row and then carries out the same process entering the
data into the next row for 100 rows. The calculations involve using a random
number which has been generated in a different cell. I need a different
random number to be generated each time the calculations are done. At the
moment the random number is the same for each row.

Any advice on how to amend this without having to creat a list o f 100
random numbers?

Many Thanks
 
G

Guest

Are the random numbers from 0 to 1 or are they randomly selected integers in
some range?
 
S

Sandy Mann

For a cell try:

=RAND()*0.4+0.05

or

N = Rnd() * 0.4 + 0.05

in the Macro
--
HTH

Sandy
(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 
V

vandenberg p

If I understand the question I belive a: Application.Calculate
inside the loop would do it.

Pieter Vandenberg

: For a cell try:

: =RAND()*0.4+0.05

: or

: N = Rnd() * 0.4 + 0.05

: in the Macro
: --
: HTH

: Sandy
: (e-mail address removed)
: (e-mail address removed) with @tiscali.co.uk


: :> they are random integers in the range 0.05 to 0.45
:>
:> "Gary''s Student" wrote:
:>
:>> Are the random numbers from 0 to 1 or are they randomly selected integers
:>> in
:>> some range?
:>> --
:>> Gary''s Student
:>>
:>>
:>> "Jules" wrote:
:>>
:>> > I'm running a macro which(using a For Loop), inputs the results from
:>> > certain
:>> > calculations into a row and then carries out the same process entering
:>> > the
:>> > data into the next row for 100 rows. The calculations involve using a
:>> > random
:>> > number which has been generated in a different cell. I need a different
:>> > random number to be generated each time the calculations are done. At
:>> > the
:>> > moment the random number is the same for each row.
:>> >
:>> > Any advice on how to amend this without having to creat a list o f 100
:>> > random numbers?
:>> >
:>> > Many Thanks
:>> >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top