Random numbers without a macro?

cat3rn

New Member
Joined
Feb 3, 2014
Messages
33
I need to figure a way to make say cells A1 thru A10 produce random numbers from 0 to 9.

I would like to do it without a macro if possible. I also need a button to generate those random numbers. I know this button may make it impossible to not use a macro, but let's see if someone can. If it has to be done with a macro then so be it. I would appreciate it if someone could help me out.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I need to figure a way to make say cells A1 thru A10 produce random numbers from 0 to 9.

I would like to do it without a macro if possible. I also need a button to generate those random numbers. I know this button may make it impossible to not use a macro, but let's see if someone can. If it has to be done with a macro then so be it. I would appreciate it if someone could help me out.

Use can use a formula

=RANDBETWEEN(0,9)

You say you want a button? That would mean a macro. On the other hand if you just want to generate a new set of random numbers based on the formulas in existing cells simply press F9 (this will recalculate your formulas, thus generating new random numbers).
 
Upvote 0
I need to figure a way to make say cells A1 thru A10 produce random numbers from 0 to 9.

If it has to be done with a macro then so be it..

Here is a macro version. This will insert random numbers in A1:A10 of the active sheet.

Code:
Sub RandomZeroToNine()
Dim i As Long
For i = 1 To 10
    Cells(i, 1).Value = Int(Rnd(9) * 10)
Next i
End Sub

Insert a shape
Right-click and choose Assign a macro
Select the macro
 
Upvote 0
I am so sorry maybe I should have been more clear.

I need to have cells A1 thru A 10 generate a random set of numbers each cell being a different number than any other in the range of cells.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top