cbs Posted August 25, 2013 Report Share Posted August 25, 2013 Dear Users, I have a combobox in the form. Combobox Values are 3, 4 and 5 values. When I chose the 3 in the combobox, I want to list on ABC's three combinations. A B C AB AC BC ABC When I chose the 4 in the combobox, I want to list on ABCD's four combinations. A B C D AB AC AD BC BD CD ABC ACD ABD BCD ABCD How can I do? 1 Quote Link to comment Share on other sites More sharing options...
uriendemonav Posted August 26, 2013 Report Share Posted August 26, 2013 on click event you can code it like this if combobox.text = 3 then listtext1.text = "A B C AB AC BC ABC" elseif combobox.text = 4 then listtext1.text = "A B C D AB AC AD BC BD CD ABC ACD ABD BCD ABCD" endif Quote Link to comment Share on other sites More sharing options...
rahmansunbeam Posted August 26, 2013 Report Share Posted August 26, 2013 combination? try http://stackoverflow.com/questions/8760185/creating-a-list-of-all-possible-unique-combinations-from-an-array-using-vba Quote Link to comment Share on other sites More sharing options...
cbs Posted August 26, 2013 Author Report Share Posted August 26, 2013 Dear Uriendemonav, combinations must be happen automatically. Is it possible? Thank you very much Quote Link to comment Share on other sites More sharing options...
cbs Posted August 26, 2013 Author Report Share Posted August 26, 2013 Dear rahmansunbeam, I look at codes but I do not solve it. Would you please write the codes in vbasic form? Thank you very much for your helps. Abdurrahman Quote Link to comment Share on other sites More sharing options...
uriendemonav Posted August 27, 2013 Report Share Posted August 27, 2013 what I wrote is just a sample coding it doesnt mean it will work in your platform. the idea works on different VB platform the syntax is the only difference. there are a bunch of sample algorithms that produces that output. do a google. Quote Link to comment Share on other sites More sharing options...
rahmansunbeam Posted August 27, 2013 Report Share Posted August 27, 2013 >>> import itertools >>> list(itertools.combinations('abcd', 2)) python... Quote Link to comment Share on other sites More sharing options...
uriendemonav Posted August 27, 2013 Report Share Posted August 27, 2013 a good explanation here for your problem I just googled "ABCD Combination" and voila !!!! the answer. google is your best friend http://www.xtremevbtalk.com/archive/index.php/t-139843.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.