Romano_odK
Active Member
- Joined
- Jun 4, 2020
- Messages
- 380
- Office Version
- 365
- Platform
- Windows
Good afternoon,
I use the below 2 sets of code to hide and unhide the commandbars and some other stuff. I would like to let this work behind one button and when let the text on the button change when you push it. Is that possible?
Thank you for your time.
Romano
I use the below 2 sets of code to hide and unhide the commandbars and some other stuff. I would like to let this work behind one button and when let the text on the button change when you push it. Is that possible?
Thank you for your time.
Romano
VBA Code:
ActiveSheet.Unprotect "trein"
Dim cb As CommandBar
For Each cb In CommandBars
If cb.Type < 3 Then cb.Enabled = False
Next cb
With ActiveWindow
.DisplayHeadings = False
.DisplayWorkbookTabs = False
End With
With Application
.DisplayFullScreen = True
.DisplayFormulaBar = False
.DisplayScrollBars = False
.DisplayStatusBar = False
End With
ActiveSheet.Protect "trein", AllowFiltering:=True
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With
VBA Code:
ActiveSheet.Unprotect "trein"
Dim cb As CommandBar
For Each cb In CommandBars
If cb.Type < 3 Then cb.Enabled = False
Next cb
With ActiveWindow
.DisplayHeadings = True
.DisplayWorkbookTabs = True
End With
With Application
.DisplayFullScreen = False
.DisplayFormulaBar = True
.DisplayScrollBars = True
.DisplayStatusBar = True
End With
'This will enable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
Cbar.Enabled = True
Next
ActiveSheet.Protect "trein", AllowFiltering:=True, AllowFormattingColumns:=True