+ Reply to Thread
Results 1 to 4 of 4

Macro to extract all possible cominations

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2016
    Posts
    1,369

    Macro to extract all possible cominations

    I have attached a list of numbers

    I would like VBA code to extract all possible combinations for 6 numbers

    I have manually extracted 3 combinations to show you what I am trying to achieve


    It would be appreciated if someone could provide me with code to do this
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,446

    Re: Macro to extract all possible cominations

    Hi Howard,

    Be careful what you wish for. You have 16 numbers and want all combinations for 6 of them. That means you can have 16 possible numbers for the first and then 15 for the second, 14 for the third and down to 11 for the last. In probability terms this looks to be 16 factorial over 10 factorial. I get somewhere north of 5 million different permutations. NOW - does the order matter? You might want Permutations instead of Combinations. Do you allow repeats of the 16 numbers or not?

    https://www.mathsisfun.com/combinato...mutations.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2016
    Posts
    1,369

    Re: Macro to extract all possible cominations

    Thanks for your reply Marvin. Order in this instance does not matter whatsoever

    I would like to extract various combinations of 6 numbers from this list in any order

  4. #4
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2016
    Posts
    1,369

    Re: Macro to extract all possible cominations

    I have attached a sample of numbers. I would like a formula or Macro to extract all the combinations in any order in groups of 6 numbers that are not the same


    I have also posted on


    https://www.mrexcel.com/board/thread...-of-6.1116578/

    Your assistance is most appreciated
    Attached Files Attached Files
    Last edited by Howardc1001; 11-30-2019 at 12:56 AM.

+ 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] Macro to extract items not used
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-04-2019, 11:37 AM
  2. [SOLVED] Macro to extract the first WS from 5 WB
    By DougELS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-09-2016, 04:17 AM
  3. Replies: 0
    Last Post: 01-03-2014, 10:04 AM
  4. [SOLVED] VBA Extract Macro
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2013, 09:42 AM
  5. [SOLVED] Pausing A Macro (allow user to extract data) aAnd Resume Macro
    By jbumps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2013, 01:59 PM
  6. Create All Cominations Function
    By bpmalone32 in forum Excel General
    Replies: 3
    Last Post: 04-03-2012, 11:40 AM
  7. Macro to extract Data
    By dandavis1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2008, 07:33 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