Forum Discussion

msm66's avatar
msm66
Brass Contributor
Jul 09, 2020
Solved

HELP WITH VBA OR FORMULA

Hi , let's say I give you a list of fruits (something like the attachment) and ask you choose the one you like from each list. let's say there are "N" items in the list and you only like 10 of them ...
  • mtarler's avatar
    Jul 09, 2020

    msm66  First off, please don't create new duplicate threads.

    As for VBA, of course VBA can do anything you can do in the sheet and more, but unless the VBA code is really small or trivial, the us volunteers here probably won't create it for you.  But in VBA you can create custom forms for data entry (I believe a PC version it is still required to create or edit the form but that they will work on a Mac, but they don't work if using Excel online).  You can also create active modules that will monitor sheet edits and make updates accordingly.

    That said, I often try to achieve the functionality in the sheet to avoid problems with others being required to approve the macro functions before the sheet will work (and in some cases they can't).

    My prior answer using drop down menus could be modified so each successive drop down list would exclude items already selected.

    Another alternative is to add another column next to the list and just have the user type an "x" in that column instead of 'checkboxes' or maybe rank their favorite foods in that column (then you could even sort by that rank).

    If you want checkboxes, they point to a cell so if you create that column next to the list and add checkboxes over each cell you can have each checkbox 'point' to that corresponding cell.

     

    So if you take the suggestion of adding a column that they rank their favorites then you could use:

    =IFERROR(INDEX(A:A,MATCH(ROW()-ROW($C$1),B:B,0)),"")

      assuming the food is in col A, the ranking is in col B, and this list is created in col C with C1 being a header line.

    Various tweaks could be made to account for non-sequential and duplicate ranking and such if needed. 

Resources