These are the macros I have to turn off the cell direction when using the Return Key on Sheet1 only. When I open the workbook, regardless if Sheet1 is activated or not, the cell direction is turned off. If I go to sheet1 first and then go to a different sheet, this is when it is deactivated and the cell direction turns back on. If I go to a different workbook, regardless if sheet1 is activated or not, the cell direction turns back off and I have to repeat the process to get it working correctly.
I have tried changing these macros to Sub Worksheet_Activate/Deactivate, and this causes the cell direction to turn off for any other workbooks if sheet1 is activated in the background.
Im just trying to get the cell direction to turn off for sheet1 only without it affecting any other sheet on the workbook or any other workbooks. Please help.
I have tried changing these macros to Sub Worksheet_Activate/Deactivate, and this causes the cell direction to turn off for any other workbooks if sheet1 is activated in the background.
Im just trying to get the cell direction to turn off for sheet1 only without it affecting any other sheet on the workbook or any other workbooks. Please help.
Code:
Option Explicit
Private Sub Workbook_Activate()
With ThisWorkbook.Sheets("Sheet1")
'Return key stays in cell for this worksheet only
Application.EnableEvents = False
Application.MoveAfterReturn = False
Application.EnableEvents = True
End With
End Sub
Private Sub Workbook_Deactivate()
With ThisWorkbook.Sheets("Sheet1")
'Return key reverts to default after selecting any other
Application.EnableEvents = False
Application.MoveAfterReturn = True
Application.EnableEvents = True
End With
End Sub