1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Random number gererator

Discussion in 'Business Applications' started by TBaker14, Jan 31, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. TBaker14

    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:
     
  2. BigTobster

    BigTobster

    Joined:
    Feb 26, 2011
    Messages:
    173
  3. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,576
    First Name:
    Hans
    He meant RAND()
     
  4. JohnWilson

    JohnWilson

    Joined:
    Nov 22, 2007
    Messages:
    262
    I don't think he does!
     
  5. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,576
    First Name:
    Hans
    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.
     
  6. JohnWilson

    JohnWilson

    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!
     
  7. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1087694

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice