The message box isn't active when you try to set focus to the control, focus should have returned to the userform as soon as the user clicked Yes/No on the message box.