VBA RandBetween
Apr 1, 2009I have tried
random_result = WorksheetFunction.randbetween(0, 36)
But failed.
Whats the VBA equivalent?
I have tried
random_result = WorksheetFunction.randbetween(0, 36)
But failed.
Whats the VBA equivalent?
I'm using the RANDBETWEEN(1,15) excel function to fill a range of cells with random numbers between 1 and 15, the problem is that each cell cannot be the same number than any other in that range, how exactly can i accomplish this?
I attached a file for a better example, if you hit F9 you can see that sometimes at least 2 cells share the same number...but I need it to be different on each one, and still be random.
how to use the =randbetween formula
I need random dates from 25 years ago to today
I am trying to use the formula below in a macro to produce the same result, but I am having trouble with the coding.
View 4 Replies View RelatedI am trying to generate random numbers between upper and lower limits (eg 120,140). The randbetween function in the help file is ideal....but when I use it it generates a #Name error.
(I am using Excel 2002 and have the analysis toolpak add in ticked).
I need the solution for the following:
1. Currently I have a randbetween() formula in cell B2.
2. Cell A1 = B2 (Every time the value in B2 changes so does the value in A1)
Instead, I want that every change in value in cell B2 is captured in progressive cells.
For example:
First iteration in cell B2, value is entered in A1.
Second change in value in B2, value is entered in A2, while value in A1 remains unchanged and so on and so forth.
Is it possbile with the randbetween function to only randomate a number when a certin object is pressed? As at the moment, every button i press or drop down data i select it will randomate a number, which i dont want to happen.
View 2 Replies View Related