MoveAfterReturn fails because sheet is protected

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Windows XP with Office 2003.
I have the following programs in a sheet module:

Private Sub Worksheet_Activate()
Application.MoveAfterReturn = False
End Sub
Private Sub Worksheet_Deactivate()
Application.MoveAfterReturn = True
End Sub

But, when the sheet is activated, the cell pointer still moves after enter.
This failure only occurs if the sheet is protected. I want it to work when
the sheet is protected.
How can I get this to work?

Thanks in advance for your assistance.
 
The code works fine on my machine... You mention that the code is in a sheet
module. Just to clarify... It is in a sheet? Not in a module.

Try putting break points on the procedures or put a message box in the
procedure just to make sure the events are firing.

Speaking of event firing... in your code anywhere do you toggle the

Application.enableevents = false

without setting it back.

Application.enableevents = true

If your events are off you are hooped and will have to reset them.

HTH
 
Jim,

Thanks for your reply. Events are not disabled anywhere in my code. The only
cells that are unlocked are those on a single row. It is strange that this
works if the sheet is not protected...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top