The code appears to be from a useform activate event, but the code appears to relate to a forms commandbutton (which is on a sheet, perhaps).

Post an example and I'm sure we'll be able to help.

CC