+ Reply to Thread
Results 1 to 6 of 6

Populate an array with unique random numbers

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    12

    Question Populate an array with unique random numbers

    Hello everyone,

    I'm need to populate an array via VBA with unique numbers between 2 and a number input by users of my form. I've tried searching and to tell the truth got tired. Please help this newbie.

    Thanks
    Kingali

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Populate an array with unique random numbers

    Try this :-
    The Results are posted to column "C" (via the "Dic.Keys" array) and the Array size is determined by "Textbox1".
    Please Login or Register  to view this content.
    Regards Mick
    Last edited by MickG; 04-18-2013 at 08:25 AM.

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Populate an array with unique random numbers

    Hi Mick,
    Thanks for the quick reply.
    I'm currently testing your code in my VBA form.
    I'll let you know how it works.

    Regards
    Kingali

  4. #4
    Registered User
    Join Date
    04-11-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Populate an array with unique random numbers

    Hi Mick,
    your code works great, once I figured out where to subsitute the user inputs.
    Thanks for the help.
    Regards
    Kingali

  5. #5
    Registered User
    Join Date
    04-11-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    12

    Thumbs up Re: Populate an array with unique random numbers

    Hi Mick,
    Your code works great, once I figured out where to subsitute the user inputs.
    This is how I have it working:

    Please Login or Register  to view this content.
    I guess that if I changed the number "2" then the lower limit will change?

    P.S. Moderator i'm not sure how to mark this as solved.

    Thanks for the help.
    Regards
    Kingali
    Last edited by Kingali; 04-18-2013 at 12:06 PM.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Populate an array with unique random numbers

    Ref:- lower limit, you thoughts are correct.
    For Showing "Solved" see "Forum Rules" at top of sheet.
    Thanks for FeedBack
    Regrds Mick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1