RANDBETWEEN
function RANDBETWEEN(arg1: any = null, arg2: any = null): number | string | boolean
Description
Returns a random number between the numbers you specify.
Parameters
- arg1
any
null Is the smallest integer RANDBETWEEN will return.
- arg2
any
null Is the largest integer RANDBETWEEN will return.
Returns
number | string | boolean
Try It
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.RANDBETWEEN(-1, 10));