Did you put it in the worksheet code module of the applicable worksheet ? It Has to be in the right worksheet module.