+ Reply to Thread
Results 1 to 13 of 13

Shuffle array VBA

  1. #1
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18

    Shuffle array VBA

    Hii guys, i need help on shuffling the array for example in Cells A1:F1 for 20 times
    I want to record every times the shuffle function run it record the result in the cells next to it. so it will be A1:F1 as it's original array, and A2:F2 until A21:F21 as the result of shuffle function.
    The problem with that code is it the result in A2:F2 until A21:F21 show the same value. Would you guys please help me..

    Please Login or Register  to view this content.
    shuffle.PNG
    Last edited by sigit21; 09-16-2018 at 08:53 PM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Shuffle array VBA

    Deleted, OP complied to Forum Rules
    Last edited by bakerman2; 09-16-2018 at 10:17 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Shuffle array VBA

    Try
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18

    Re: Shuffle array VBA

    It work great. Thank you so much Jindon..

  5. #5
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18

    Re: Shuffle array VBA

    Quote Originally Posted by jindon View Post
    Try
    Please Login or Register  to view this content.
    Jindon, I figure out that the code could result duplicate values. Can you make it to be non-repeating shuffle?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Shuffle array VBA

    What do you mean by "duplicate"?

  7. #7
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18

    Re: Shuffle array VBA

    duplicate.PNG

    as you see in the picture above, there are two cells that has same values

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Shuffle array VBA

    Try
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18

    Re: Shuffle array VBA

    Quote Originally Posted by jindon View Post
    Try
    Please Login or Register  to view this content.
    Thankyou Jidon it works, but only for small number of repetition. When i try to do it in large repetition it shows some blank column. Why does it could be like that?
    1.PNG
    2.PNG

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Shuffle array VBA

    When i try to do it in large repetition
    It will be totally different question.
    The code I posted was only for a small repetition.

  11. #11
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18
    Quote Originally Posted by jindon View Post
    It will be totally different question.
    The code I posted was only for a small repetition.
    Owhh i see, can you do me a favor to create the code that work for large repetition please? I really appreciate it. ThankYou

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Shuffle array VBA

    For the moment just delete the line
    Please Login or Register  to view this content.
    and see how it goes.

  13. #13
    Registered User
    Join Date
    09-06-2018
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    18
    Quote Originally Posted by jindon View Post
    For the moment just delete the line
    Please Login or Register  to view this content.
    and see how it goes.
    It works. Thank You so much Jidon for your help. 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. [SOLVED] Improving array shuffle
    By Kyle123 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-17-2015, 09:25 AM
  2. [SOLVED] Shuffle array (Scheduling)
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-22-2015, 08:59 AM
  3. New to VBA, Shuffle Words
    By SteelMessiah in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2013, 04:32 PM
  4. [SOLVED] Shuffle Right
    By keen2xl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2013, 01:40 AM
  5. Mix/shuffle cells around
    By kiapiggy in forum Excel General
    Replies: 4
    Last Post: 11-07-2011, 09:31 AM
  6. Excel 2007 : How to shuffle words in a row?
    By emil9216 in forum Excel General
    Replies: 9
    Last Post: 10-24-2011, 02:16 PM
  7. [SOLVED] Shuffle Array
    By Rik Smith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-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