+ Reply to Thread
Results 1 to 7 of 7

Code to generate 2000 unique 8 digit numbers

  1. #1
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Code to generate 2000 unique 8 digit numbers

    Hi All,

    Can someone help with some code to generate 2,000 unique 8 digit numbers

    Thanks

    Kevin

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Code to generate 2000 unique 8 digit numbers

    Good morning Excelski

    Why code?
    Code writing is work intensive for someone to do, but this could be done in one worksheet with a few formulae, to generate the random numbers, and double check they are all unique.

    DominicB

  3. #3
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Code to generate 2000 unique 8 digit numbers

    Hi DominicB,

    Thanks for looking, I had assumed that code was needed for this task, but I am happy with formulas

    Kevin

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Code to generate 2000 unique 8 digit numbers

    Nonetheless, there are lots of free solutions out there. Here is one: https://www.exceltip.com/tips/random...ut-repeat.html

    Adapted workbook from that link attached.
    Last edited by AliGW; 07-20-2017 at 06:55 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Code to generate 2000 unique 8 digit numbers

    Hi Excelski

    In A1 put this formula and copy down to 2000.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In B1 put this formula and copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Put this formula in C1.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As long as C1 gives the answer 2000, there will be no duplicates. If C1 doesn't equal 2000, then just recalculate.

    HTH

    DominicB

  6. #6
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Code to generate 2000 unique 8 digit numbers

    Thank you both!

    Both solutions work great

    Kevin

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Code to generate 2000 unique 8 digit numbers

    You're welcome!

+ 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: 20
    Last Post: 09-27-2019, 10:11 AM
  2. [SOLVED] 5-digit Random Unique Alphanumeric Code
    By mcodden in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-15-2015, 04:32 PM
  3. [SOLVED] 5-digit Random Unique Alphanumeric Code
    By mcodden in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2015, 02:39 PM
  4. [SOLVED] I have a workbook that I need to auto generate a unique daily 6 digit key number at the pr
    By harry h in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-16-2014, 07:48 AM
  5. [SOLVED] VBA to generate random 5-digit serial numbers using
    By emymeeky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2014, 03:34 PM
  6. Replies: 1
    Last Post: 10-16-2013, 02:46 PM
  7. How do I generate a list of 5-digit numbers in Excel?
    By Cowboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-29-2005, 11:05 AM

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