Hello guys...
First off to say that i'm new on this forum (well, my posts are proof of that)... Second, I have a problem with editing a macro I've found over the internet...
What macro does is this:
it calculates combinations or permutations (A1), based on number class you give(A2), and items you enter in sheet1 (A3:...), then it writes those combinations/permutations in a new sheet... If the number of combinations/permutations is more than there is rows in a single column, it skips to second column, and continues where it left off...
I have edited code, and changed so it skips a column (ColNum = ColNum + 2), and now comes my problem... I need to add a part in the macro that will calculate the sum of items that are contained in the each of the combination and write it in the empty columns... So, Column A will be filled with combinations, column B with sums of items in each of those combinations, column C is the next column of combinations, and column D sum of those combinations etc...
Code for combinations/permutations is:
and I can't seem to find my sum function anywhere, but I've also found it over google... There was a new function defined called SumInCell, and it evaluated and substituted , with +, and calculated sum... Now I need to find a way to add that code into combinations code and to skip a column, then calculate sums for next column etc... I hope you get the point...
If I find SumInCell code, I will post it...
Hope someone can help me Thanks in advance...
EDIT:
Found a similar code:
Where Test is a function that should be typed in every other column... However, it could be changed into a macro that will run together with the code above...
Bookmarks