How do I set up a "Random Number" button in Excel?
Im creating a quote price spreadsheet to keep track of what we quote our
customers and in one of the rows I would like to add a button that generates a random number. This random number becomes the ID number so we can give to our customer in case that they reach another representative. Is this possible? |
Answer: How do I set up a "Random Number" button in Excel?
Yes, it is definitely possible to create a button that generates a random number in Excel. Here are the steps to set it up:
That's it! You now have a button that generates a random number in Excel. You can customize the code to generate a different range of numbers or to put the number in a different cell if needed. |
How do I set up a "Random Number" button in Excel?
On Tue, 24 Oct 2006 14:25:02 -0700, jnoriega
wrote: I’m creating a quote price spreadsheet to keep track of what we quote our customers and in one of the rows I would like to add a button that generates a random number. This random number becomes the ID number so we can give to our customer in case that they reach another representative. Is this possible? Just add a button from the toolbox, right click and put something like the following code in the button's click event. Private Sub CommandButton1_Click() Randomize ActiveCell = Round(Rnd * 1000, 0) End Sub But are you sure you want a random number? It's possible that you might still duplicate a number. Why not control a normal variable number by incrementing it by say 1, each time the button is pressed? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
All times are GMT +1. The time now is 05:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com