Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jwomack
 
Posts: n/a
Default can you have randbetween not RE-calculate?

I am making facotring practice for my students and want to use the
randbetween but do not want it to recalculate everytime.
  #2   Report Post  
David Billigmeier
 
Posts: n/a
Default

Couple options:

1) You can turn automatic calculation off in your workbook so every time you
want the rand function to re-calculate you have to hit the F9 key...
Tools-Options-'Calculation' Tab-Check 'Manual'

2) You can set up a UDF, something like:
Function rand2()
rand2 = Rnd
End Function

3) When you enter the randbetween() function instead of commiting it by
pressing "Enter" commit by pressing F9

--
Regards,
Dave
<!--


"jwomack" wrote:

I am making facotring practice for my students and want to use the
randbetween but do not want it to recalculate everytime.

  #3   Report Post  
Harald Staff
 
Posts: n/a
Default

Formulas recalculate. Try selecting the cells and run a little random number
writing macro instead, something like:

Sub RandNums()
Dim L As Long
Dim H As Long
Dim Cel As Range

L = 10 'min
H = 50 'max

Randomize
For Each Cel In Selection
Cel.Value = L + Int(Rnd * (H - L + 1))
Next
End Sub

HTH. Best wishes Harald

"jwomack" skrev i melding
...
I am making facotring practice for my students and want to use the
randbetween but do not want it to recalculate everytime.



  #4   Report Post  
Bernd Plumhoff
 
Posts: n/a
Default

Hello,

instead of using
=randbetween(LOW,HIGH)
you could use
=uniqrandint(HIGH-LOW+1,FALSE)+LOW-1
entered normally (no array-formula).
See www.sulprobil.com for my UDF uniqrandint().

The second parameter (FALSE) tells my function to be non-volatile, that
means: do not recalculate with each F9.

HTH,
Bernd

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with sumif to calculate column rvnwdr Excel Discussion (Misc queries) 3 June 30th 05 12:38 AM
How can I calculate Vacation Time earned based on length of emplo. Kim Excel Discussion (Misc queries) 2 March 15th 05 08:04 PM
formula to calculate # of days between dates, excluding holidays abs2299 Excel Discussion (Misc queries) 8 March 3rd 05 02:21 AM
Not able to calculate. mark_kramarczyk Excel Worksheet Functions 1 December 29th 04 08:55 PM
How do you calculate the nth root of a number in Excel 2003? William Excel Worksheet Functions 2 November 17th 04 04:19 PM


All times are GMT +1. The time now is 05:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"