I don't see where pageCounter is declared. To trouble shoot we'd really need to whole code, or better yet an example workbook with code in place.