Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am generating a random number as follows: =RANDBETWEEN(10000000;99999999) How can I make the cell recalculate a new random number every time I click the cell? Is this possible? Thanks, Miguel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On the off chance you don't know this, just pressing F9 will cause the sheet
to recalc. Since RANDBETWEEN() is volatile, it will recalc. Otherwise you can use a macro to do it. Right-click on the sheet tab and select VIEW CODE. Paste in this macro to the sheet module that appears: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$B$5" Then Calculate Range("C5").Select End If End Sub Edit the $B$5 to the cell where you want it to watch. Then close the editor and save the sheet. Now, click on any other cell, then click on B5. It should reassert a new value each time you click on it. Does that help? -- "Actually, I *am* a rocket scientist." -- JB (www.MadRocketScientist.com) Your feedback is appreciated, click YES if this post helped you. "shapper" wrote: Hello, I am generating a random number as follows: =RANDBETWEEN(10000000;99999999) How can I make the cell recalculate a new random number every time I click the cell? Is this possible? Thanks, Miguel . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Addding a Random number to a fixed number..... | Excel Discussion (Misc queries) | |||
How can I match a random number with closest number from sequence? | Excel Worksheet Functions | |||
same number appears in a random number generator | Excel Worksheet Functions | |||
Generating (in a random order)each number once from a given number | Excel Worksheet Functions | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) |