Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=1+INT(RAND()*6)
HTH. Best wishes Harald "Audrey" skrev i melding ... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBA
num = int(rnd()*6+1) Excel =trunc(rand()*6+1) -- Regards, Tom Ogilvy "Audrey" wrote in message ... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the formulas below, it struck me as odd you used INT in the VBA one but
avoided it in the Excel one. Is there a programming reason for this, or is it just a personal preference? Thanks Darren On Sun, 8 May 2005 09:50:35 -0400, Tom Ogilvy wrote: VBA num = int(rnd()*6+1) Excel =trunc(rand()*6+1) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trunc is more descriptive, but not available in VBA. The INT
worksheetfunction has no relation to the VBA INT function. -- Regards, Tom Ogilvy "Darren Hill" wrote in message news:opsqgwcamved89cl@omega... In the formulas below, it struck me as odd you used INT in the VBA one but avoided it in the Excel one. Is there a programming reason for this, or is it just a personal preference? Thanks Darren On Sun, 8 May 2005 09:50:35 -0400, Tom Ogilvy wrote: VBA num = int(rnd()*6+1) Excel =trunc(rand()*6+1) |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for clarifying.
Darren On Sun, 8 May 2005 21:31:09 -0400, Tom Ogilvy wrote: Trunc is more descriptive, but not available in VBA. The INT worksheetfunction has no relation to the VBA INT function. -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 8 May 2005 06:06:04 -0700, Audrey
wrote: and just for another method, if you have the Analysis ToolPak installed: =RANDBETWEEN(1,6) If this function is not available, and returns the #NAME? error, install and load the Analysis ToolPak add-in. On the Tools menu, click Add-Ins. In the Add-Ins available list, select the Analysis ToolPak box, and then click OK. If necessary, follow the instructions in the setup program. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
function to give the number of hours | Excel Worksheet Functions | |||
generate a random number and use if function to generate new data | Excel Worksheet Functions | |||
random number function | Excel Worksheet Functions | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) | |||
Minutes multiplied by a number to give a number | Excel Discussion (Misc queries) |