I have now fixed this using a formula and a macro I found in another thread on the site. Many thanks!