Did you place the code in a module or in a worksheet event or workbook event?