+ Reply to Thread
Results 1 to 9 of 9

Auto filling a table based upon another table

  1. #1
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Auto filling a table based upon another table

    Hi ,

    I am looking for a way to fill a table based upon a table I created. For example in the first columns I have a list of colors, in the second column I have a list of products and in the third column I have a choice of yes and no.
    I want to create from this a list of all the possible outcomes from adding column 1 to column 2 and 3.

    Thanks in advance

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

    Re: Auto filling a table based upon another table

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Keep it simple
    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Auto filling a table based upon another table

    Thank you for the quick response.

    I attached a dummy workbook with the basic idea i would like to resolve

    Column E displays the output of the loop I want to run. Which is, for every cell which has a value in every colum the output should be the addition of cells together

    so here the output would be a total of 9 different outcomes (3*3*3) which is cell a1+b1+c1 the next would be a1+b1+c2 and so forth.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Auto filling a table based upon another table

    see attachment, run macro "test", hope this helps
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Auto filling a table based upon another table

    Works great, thanks allot. I am going to try to add more columns to the equation.

  6. #6
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Auto filling a table based upon another table

    It seems to work properly only when all columns have the same amount of rows filled . I have tried using the same formula when I have over 200 rows and there is an error. There is supposed to be 5 columns. Some of the columns do not have the same amount of rows , so empty cells should be skipped. I tried adding code for the fourth and fifth column but i also recieve an error.

    Thanks again for the great help

  7. #7
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Auto filling a table based upon another table

    I attached the file I am working on. I have added the code for the five columns. It works well.

    When I add the number 17 in cell E17 and then run the macro there is some error. I think excel is running out of memory or rows.

    Is there any way around it? I don't mind if the output is to a text file with a link break between each output
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Auto filling a table based upon another table

    if to assume that all rows have 5 values (no empty cells), number of combinations:

    rows col total
    3 5 243
    4 5 1024
    5 5 3125
    6 5 7776
    8 5 32768
    17 5 1419857
    200 5 320000000000

  9. #9
    Registered User
    Join Date
    01-06-2011
    Location
    brooklyn, new york
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Auto filling a table based upon another table

    How large of a text file is that?

    If I export and append each part of the loop to a text file will it still crash?

+ 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