+ Reply to Thread
Results 1 to 11 of 11

Generate random sequence of numbers in excel

  1. #1
    Registered User
    Join Date
    03-31-2011
    Location
    Canada, Toronto
    MS-Off Ver
    Excel 2003
    Posts
    9

    Generate random sequence of numbers in excel

    Hi everyone !

    Can someody help me generate a sequence of numbers like
    0
    1
    2 2
    3 3 3
    4 4 4 4
    till 200

    in excel with the help of a macro ??
    My code is like this :

    Please Login or Register  to view this content.
    Thank you !
    Last edited by excelvb; 04-06-2011 at 06:20 AM.

  2. #2
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Generate random sequence of numbers in excel

    Perhps this
    Please Login or Register  to view this content.
    regards

    johnjohns

    When you are not sure where to go, every road takes you there!

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Generate random sequence of numbers in excel

    To generate 200 unique random numbers:

    Please Login or Register  to view this content.



  4. #4
    Registered User
    Join Date
    03-31-2011
    Location
    Canada, Toronto
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Generate random sequence of numbers in excel

    Yes, this is exactly what i wanted. We are almost there ! Can we display the result cell by cell instead of one cell ?
    My code now looks like this :

    Please Login or Register  to view this content.
    Thanks !

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Generate random sequence of numbers in excel

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Generate random sequence of numbers in excel

    Perhaps this too
    Please Login or Register  to view this content.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Generate random sequence of numbers in excel

    @johnjohns

    Avoid Select & Activate in VBA (unnecessary)

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Generate random sequence of numbers in excel

    I wouldn't call that random.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Generate random sequence of numbers in excel

    Neither would I.

  10. #10
    Registered User
    Join Date
    03-31-2011
    Location
    Canada, Toronto
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Generate random sequence of numbers in excel

    Thank you so much for your help guys ! It's working perfectly !

  11. #11
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Generate random sequence of numbers in excel

    Even a one-liner suffices:

    Please Login or Register  to view this content.

+ 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