+ Reply to Thread
Results 1 to 4 of 4

RANDBETWEEN No Repeats w/ VBA Macro Button

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2011
    Posts
    44

    RANDBETWEEN No Repeats w/ VBA Macro Button

    Hey All,

    I believe this is a fairly easy problem I am trying to solve, but I'm still in the beginning stages of learning VBA. I created a macro button that places random numbers in 6 assigned boxes. However, I cannot have any repeat numbers. I don't know how to implement the "no repeat" syntax into my code. Any help would be appreciated.

    Please Login or Register  to view this content.
    Thank you,
    Brandon


    Random.xlsb

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: RANDBETWEEN No Repeats w/ VBA Macro Button

    You will want to utilize a unique random number generator. Something like this: http://stackoverflow.com/questions/1...bers-using-vba
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: RANDBETWEEN No Repeats w/ VBA Macro Button

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    10-22-2014
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2011
    Posts
    44

    Re: RANDBETWEEN No Repeats w/ VBA Macro Button

    Thank you both for your help.

    AlphaFrog,

    Your code worked great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 10
    Last Post: 07-03-2015, 04:29 PM
  2. [SOLVED] Button that will run RANDBETWEEN()
    By michaljireht in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2015, 01:28 AM
  3. Why am I getting number repeats in a row from macro
    By b_rianv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2014, 03:19 PM
  4. Replies: 6
    Last Post: 12-09-2012, 09:00 PM
  5. Possible Macro? Process repeats itself
    By Wheelie686 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2012, 07:28 PM
  6. Formulae for: 4 most repeats,4 least repeats in a series of numbers
    By Sedge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2010, 04:56 AM
  7. [SOLVED] Macro repeats and then stops
    By Sabba Efie in forum Excel General
    Replies: 2
    Last Post: 08-15-2006, 06:05 PM

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