You need to place the macro in "This Workbook" not in "Sheet6"