Hi Eauth
I've tried (and also modified) your code and can now get it to work, so I'm pleased to have made progress.
I'm sure this will be much simpler than writing a VB macro.
Thanks for introducing me to AWK and all your help.
I'm sure some other CNCers will also see the benifits.