For anyone reading this thread the code itself behaves correctly. The issue appears to have been the location of the code in the project. The code had been placed in a sheet code page and was being run from another sheet.
Moved the code to a module and repointed the buttons to this and all appeared to work fine.
G North MMI