![]() |
MoveAfterReturn fails because sheet is protected
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. |
MoveAfterReturn fails because sheet is protected
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 "quartz" wrote: 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. |
MoveAfterReturn fails because sheet is protected
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... "Jim Thomlinson" wrote: 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 "quartz" wrote: 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. |
All times are GMT +1. The time now is 11:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com