+ Reply to Thread
Results 1 to 6 of 6

VBA output very slow for random numbers

  1. #1
    Registered User
    Join Date
    04-05-2019
    Location
    cape town
    MS-Off Ver
    2016
    Posts
    16

    VBA output very slow for random numbers

    Hi

    I have a spreadsheet that generates numbers that are non repetitive for a defined set. E.g It creates x non repeated numbers for every y amount of numbers. I can change the settings so can do as many as i need. I can also set the min and max number like with the Rand() function.

    I can have a list of 1000 numbers and for every 10 numbers there are no repetitions.

    The only problem is that its incredibly slow. Is there a way to improve this?




    Please Login or Register  to view this content.
    Last edited by AliGW; 12-28-2019 at 08:07 AM. Reason: Solved tag added - no need to edit thread title or add solved to post. Thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    12,897

    Re: VBA output very slow for random numbers

    For me. when I ran your code it took .34375 seconds

  3. #3
    Registered User
    Join Date
    04-05-2019
    Location
    cape town
    MS-Off Ver
    2016
    Posts
    16
    Quote Originally Posted by davesexcel View Post
    For me. when I ran your code it took .34375 seconds
    Yeah it gets really slow with 2000 numbers and more.
    Last edited by FanAnd22; 12-28-2019 at 04:49 AM.

  4. #4
    Registered User
    Join Date
    04-05-2019
    Location
    cape town
    MS-Off Ver
    2016
    Posts
    16

    Re: VBA output very slow for random numbers

    I think excel simply struggles to work fast as the numbers increase. So running it on multiple work books and then pasting everything together afterwards seems to be a more efficient way of running things

    Thanks

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    18,509

    Re: [SOLVED]VBA output very slow for random numbers

    try
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-05-2019
    Location
    cape town
    MS-Off Ver
    2016
    Posts
    16
    Quote Originally Posted by jindon View Post
    try
    Please Login or Register  to view this content.
    Thank you so much. This is 100 times faster..
    It's really really fast. I Can't process the difference. Thank you

+ 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: 2
    Last Post: 07-24-2018, 03:47 AM
  2. [SOLVED] macro created buttons not working, random numbers not random
    By dareeldill in forum PowerPoint Programing
    Replies: 4
    Last Post: 07-01-2017, 09:16 AM
  3. Filtering random numbers without regenerating random numbers
    By ptack in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2014, 02:36 PM
  4. Storing the output generated from random numbers in different cells
    By rafat125 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-12-2013, 02:07 AM
  5. Random Output
    By mycon73 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-16-2007, 11:49 PM
  6. [SOLVED] Non-random numbers generated by excel's data analysis random gener
    By Allie in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-17-2005, 02:05 AM
  7. Replies: 2
    Last Post: 09-13-2005, 12: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