Ok. well anyway the OP divulged some more info about the his requirements at Re^2: Next permutation and I wrote some code in response to that. The OP wants some enhancements and I've asked the OP to give it a stab on his own. Let's see how that goes......