+ Reply to Thread
Results 1 to 2 of 2

VBA to list all possible combinations

  1. #1
    Registered User
    Join Date
    08-01-2019
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    19

    VBA to list all possible combinations

    I heard that possibilities with VBA are endless. I am a beginner. I need hlep with the folowing problem.
    Cells A1 to G1 can be any number within 1 to 9
    Example:
    A1 B1 C1 D1 E1 F1 G1
    2 3 8 1 9 2 2

    I need a formula or VBA code to list the following possible combinations between number 1 to 50
    In this list, the sum of the digits in a cell is equal the respective cell above in row A1 to G1
    Order is important in each row. It should be increasing from 1 to 50 and numbers should not repeat in the same row.

    2 3 8 10 18 20 29
    2 3 8 10 18 20 38
    2 3 8 10 18 20 47
    2 3 8 10 18 29 38
    2 3 8 10 18 29 47
    2 3 8 10 18 38 47
    2 3 8 10 27 29 38
    2 3 8 10 27 29 47
    2 3 8 10 27 38 47
    2 3 8 10 36 38 47
    2 3 8 19 27 29 38
    2 3 8 19 27 29 47
    2 3 8 19 27 38 47
    2 3 8 19 36 38 47
    2 3 8 28 36 38 47
    2 3 17 19 27 29 38
    2 3 17 19 27 29 47
    2 3 17 19 27 38 47
    2 3 17 19 36 38 47
    2 3 17 28 36 38 47
    2 3 26 28 36 38 47
    2 12 17 19 27 29 38
    2 12 17 19 27 29 47
    2 12 17 19 27 38 47
    2 12 17 19 36 38 47
    2 12 17 28 36 38 47
    2 12 26 28 36 38 47
    2 21 26 28 36 38 47
    11 12 17 19 27 29 38
    11 12 17 19 27 29 47
    11 12 17 19 27 38 47
    11 12 17 19 36 38 47
    11 12 17 28 36 38 47
    11 12 26 28 36 38 47
    11 21 26 28 36 38 47
    20 21 26 28 36 38 47

    Is this possible?

    thanks

    Siva
    Last edited by drgorantla; 10-15-2019 at 04:30 AM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA Help please

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    - Battle without fear gives no glory - Just try

+ 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