Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Can somebody tell me how to do this in Excel I wish to create random number between 1 to 64 with reset value 0, when a submit button is pressed a random single number is generated between 1 to 64 and when reset button is pressed it goes back to 0 or nil value. Regards, Mukhtar |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
Add the following code to a standard module in your workbook (instructions below if you don't know how) Sub Generate1to64() If Range("H1") 0 Then Range("H1") = 0 Exit Sub End If Range("H1") = "=RANDBETWEEN(1,64)" End Sub This uses cell H1 on the sheet, change the location to suit. It relies upon the Analysis Toolpak, so ensure ToolsAddinsanalysis Toolpak is checked. From the Forms toolbar, add a button to your sheet and assign the macro above to it. You can copy the code and paste it into your Visual Basic Editor (VBE) in a Standard Module located in your file. To do this, Alt + F11 (open VBE) Ctrl + R (open Project Explorer) Select the file name on the left Insert Module Paste code in Module David McRitchie has lots of useful help on his site at http://www.mvps.org/dmcritchie/excel/install.htm http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Roger Govier wrote in message ups.com... Hi, Can somebody tell me how to do this in Excel I wish to create random number between 1 to 64 with reset value 0, when a submit button is pressed a random single number is generated between 1 to 64 and when reset button is pressed it goes back to 0 or nil value. Regards, Mukhtar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Random cell/number and dont repeat selected cell/number | Excel Discussion (Misc queries) | |||
Pulling Data off Web - Need Function Help | Excel Worksheet Functions | |||
same number appears in a random number generator | Excel Worksheet Functions | |||
random number generation | Excel Worksheet Functions | |||
Random Number Questions | Excel Worksheet Functions |