tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,834
- Office Version
- 365
- 2019
- Platform
- Windows
I use the following code to add back the ribbon and bars when I move off a particular worksheet:
The problem is BEFORE I move off my particular worksheet, if I click Ctrl + N, the newly created workbook also hides the ribbon and bars, when actually I DON'T want them to be hidden.
It's as if clicking Ctrl + N does NOT activate the above code.
How can I make the above code run when Ctrl + N is pressed?
Thanks
Code:
Private Sub Worksheet_Deactivate()
With Application
.ScreenUpdating = False
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
.DisplayFormulaBar = True
.DisplayScrollBars = True
End With
With ActiveWindow
.DisplayHeadings = True
.DisplayWorkbookTabs = True
End With
Application.ScreenUpdating = True
End Sub
The problem is BEFORE I move off my particular worksheet, if I click Ctrl + N, the newly created workbook also hides the ribbon and bars, when actually I DON'T want them to be hidden.
It's as if clicking Ctrl + N does NOT activate the above code.
How can I make the above code run when Ctrl + N is pressed?
Thanks
Last edited: