OK. I am pleased you have come up with a solution.I cannot see an easy way to simplify what you are doing.As with any code, you may be able to speed it up by stopping screenUpdatingand calculating while it runs.