Random number gererator

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

TBaker14

Thread Starter
Joined
Feb 11, 2010
Messages
132
I'd like to know if there is a formula to randomly generate numbers between 0 - 9 over 10 cells...but with no duplicates.

Thoughts?

TBaker14
:eek:
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,612
RANK() is to set the ranking of series of numbers, RAND() is the random generator, maybe the link is Okay, I did not check that but RAND() is the number generator.
 
Joined
Nov 22, 2007
Messages
262
Tushar was using the RANK Function. I think I'd do this

Example call NONREPEATRAND 1,13,"C10"

Function NONREPEATRAND(lngLower As Long, lngUpper As Long, STARTCELL As String)
Dim ocol As New Collection
Dim i As Integer
For i = lngLower To lngUpper
ocol.Add i
Next
Randomize
For c = 1 To lngUpper - lngLower
i = Int(Rnd * ocol.Count) + 1
Sheet1.Range(STARTCELL).Offset(c).Value = ocol(i)
ocol.Remove (i)
Next c
End Function

I'm sure there's an easier way in Excel but then I'm a PowerPoint coder!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top