PDA

View Full Version : Random function VBA



anthony0311
05-25-2011, 04:32 AM
Hi,

I m new in VBA. I have to generate a random number between -1 and 1 on the first column from A1 to A1000. I try to use the function randbetween but it generates only integers. I m stuck on this. I may appear very basic for some people.

Cheers for your help

Bob Phillips
05-25-2011, 05:00 AM
If you want random numbers between -1 and 1 say to one dec place, try something like

=RANDBETWEEN(-10,10)/10

anthony0311
05-25-2011, 05:21 AM
Thanks
I found even better [2*rand()]-1