Hi Rioran,

thank you! Yes - xls will not have enough rows due to the combinatorical "explosion" by the above term (N+S-1)! / (S!*(N-1)!).

I will post a short version of my non-flexible code below. Hope that helps.

Have a good evening
Kai