I've implemented my own suggestion of moving the variable statements all into the main macro but it still doesn't work. Any ideas? Is it simply because the variable is forgotten when you run another macro.