+ Reply to Thread
Results 1 to 5 of 5

Generate unique number

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Generate unique number

    Hi all,

    Is it possible to have a worksheet which has two buttons one of which generates a number between 1-100 and the other generates one from 101-200?

    Many thanks,

    Adele

  2. #2
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Wink Re: Generate unique number

    Hi Adele,

    Have you used the Randbetween Function Before:

    In seperate cells put the following

    1-100
    Please Login or Register  to view this content.
    For the 101-200
    Please Login or Register  to view this content.
    Then just press F9 to randomly generate the numbers each time

    Hope this helps
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Generate unique number

    by the way you'd best be a Leeds fan lol! MOT!

  4. #4
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Generate unique number

    Should have said the numbers must be sequential so same two aren't used twice and sorry don’t like football!

  5. #5
    Registered User
    Join Date
    01-10-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Generate unique number

    Hi Adeleex,

    I did something similar to this. I had a column in the spreadsheet containing all the previous values (in any order). You can then use this code in your macro:

    Please Login or Register  to view this content.

    Where X is the column containing all the previous values.

    Does that help?

    Kind regards,
    ssu95bm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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