Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / May 2008



Tip: Looking for answers? Try searching our database.

worksheet menu bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Deb - 04 May 2008 00:29 GMT
I need to change the menu bar just for one worksheet in the workbook.  Need
help !!
Jim Gordon MVP - 04 May 2008 17:58 GMT
> I need to change the menu bar just for one worksheet in the workbook.  Need
> help !!

Hi Deb,

What version of Excel are you using?

-Jim

Signature

Jim Gordon
Mac MVP

MVPs are independent experts who are not affiliated with Microsoft.
http://mvp.support.microsoft.com/

Visit my blog
http://blog.360.yahoo.com/blog-i7JMeio7cqvhotIUwCzaJWq9

Deb - 04 May 2008 18:11 GMT
Hi Jim,

2002

> > I need to change the menu bar just for one worksheet in the workbook.  Need
> > help !!
[quoted text clipped - 4 lines]
>
> -Jim
JE McGimpsey - 06 May 2008 16:03 GMT
> 2002

This is a newsgroup for Mac XL (hence the .mac. in the title), but this
is one way you can do it in any version other than MacXL08:

Put this in the worksheet code module (right-click the worksheet tab and
choose View Code):

   Private Sub Worksheet_Activate()
       'Create a new bar, or make changes...
       'For instance:
       On Error GoTo ResetMenu
       With Application.CommandBars(1)
           With .Controls.Add( _
                       Type:=msoControlPopup, Temporary:=True)
               .Caption = "My Menu"
               .Tag = "MyMenu"
               With .Controls.Add( _
                       Type:=msoControlButton, Temporary:=True)
                   .Caption = "My Control"
                   .Tag = "MyControl"
                   .OnAction = "MyMacro"
                   .Style = msoButtonCaption
                   .TooltipText = "run my macro"
                   .Visible = True
                   .Enabled = True
               End With
               .Visible = True
               .Enabled = True
           End With
       End With
  ExitActivate:
       Exit Sub
  ResetMenu:
       Application.CommandBars(1).Reset
       Resume ExitActivate
   End Sub

   Private Sub Worksheet_Deactivate()
       On Error GoTo EndDeactivate
       'Either restore the original bar,
       'undo the individual changes (preferred), e.g.:
       Application.CommandBars.FindControl(Tag:="MyMenu").Delete
       'or
       'Application.CommandBars(1).Reset
  ExitDeactivate:
       Exit Sub
  EndDeactivate:
       'handle error here - or reset menu bar
       Resume ExitDeactivate
   End Sub
Deb - 06 May 2008 22:38 GMT
Thanks,  I let you know how i make out.

Deb

> > 2002
>
[quoted text clipped - 47 lines]
>         Resume ExitDeactivate
>     End Sub
Deb - 08 May 2008 22:06 GMT
Hi JE,

I tried this it's not working.  I have 3 sheets in this workbook.  I want
one sheet to have a different menu bar that i created, not the "worksheet
menu bar".  Also when I close out of that workbook  I need the menu bar to to
be the original one not the one I created in that other worksheet.

> > 2002
>
[quoted text clipped - 47 lines]
>         Resume ExitDeactivate
>     End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.