hide menu bar

K

kalpesh

Hello

my workbook contin 3 workshee

IN worksheet 1 i create a macro for hide toolbar & menubar when active
sheet

my code is belo


Sub RemoveToolbars(

On Error Resume Nex

With Applicatio

.DisplayFullScreen = Tru

.CommandBars("Full Screen").Visible = Fals

.CommandBars("MyToolbar").Enabled = Tru

.CommandBars("MyToolbar").Visible = Tru

.CommandBars("Worksheet Menu Bar").Enabled = Fals

End Wit

On Error GoTo

End Su

Sub RestoreToolbars(

On Error Resume Nex

With Applicatio

.DisplayFullScreen = Fals

.CommandBars("MyToolbar").Enabled = Fals

.CommandBars("Worksheet Menu Bar").Enabled = Tru

End Wit

On Error GoTo

End Su


Private Sub Worksheet_Activate(
Call RemoveToolbar
Worksheets(1).ScrollArea = "a1:f10

End Su


Private Sub Worksheet_Deactivate(
Call RestoreToolbar
End Su


now my problem is when sheet 1 activet menubar is hide but sheet 1 is activat
& close the excel & then after again i open this file the menubar is d
not hide but i select sheet 2 & then select sheet 1 then menubar is hid

why
 
G

Gord Dibben

Add this code to Thisworkbook module.


Private Sub Workbook_Open()
Dim ws As Worksheet
If ActiveSheet.Name = "Sheet1" Then
With ActiveSheet
.ScrollArea = "a1:f10"
End With
End If
Call RemoveToolbars
End Sub


Gord
 

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

Top