This is not quite what I meant. I want it to generate combinations not variations, order of the elements is irrelevant. Example: 121 is equal to 211 or 112. Anyway thanks. Tomaz