+ Reply to Thread
Results 1 to 5 of 5

disable right click menu

  1. #1
    JT
    Guest

    disable right click menu

    I have a macro where when I right click on a cell, I get a
    form to display through a private sub. However, once the
    form is closed, the "usual" menu (cut, copy, insert, etc.)
    you get when you right click is displayed.

    Is there a way to disable the "usual" menu from appearing
    on this worksheet only?

    Thanks for the help.

  2. #2
    Bob Phillips
    Guest

    Re: disable right click menu

    Put this in the ThisWorkbook code module

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.Name = "Sheet1" Then
    CommandBars("Cell").Enabled = False
    Else
    CommandBars("Cell").Enabled = True
    End If
    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JT" <[email protected]> wrote in message
    news:[email protected]...
    > I have a macro where when I right click on a cell, I get a
    > form to display through a private sub. However, once the
    > form is closed, the "usual" menu (cut, copy, insert, etc.)
    > you get when you right click is displayed.
    >
    > Is there a way to disable the "usual" menu from appearing
    > on this worksheet only?
    >
    > Thanks for the help.




  3. #3
    Jake Marx
    Guest

    Re: disable right click menu

    Hi JT,

    I'm assuming that you've used the Worksheet_BeforeRightClick event. If
    that's the case, insert this line of code somewhere in that routine:

    Cancel = True

    --
    Regards,

    Jake Marx
    MS MVP - Excel
    www.longhead.com

    [please keep replies in the newsgroup - email address unmonitored]


    JT wrote:
    > I have a macro where when I right click on a cell, I get a
    > form to display through a private sub. However, once the
    > form is closed, the "usual" menu (cut, copy, insert, etc.)
    > you get when you right click is displayed.
    >
    > Is there a way to disable the "usual" menu from appearing
    > on this worksheet only?
    >
    > Thanks for the help.



  4. #4
    Jim Thomlinson
    Guest

    RE: disable right click menu

    Add

    Cancel = True

    One of the arguments of the sub is cancel and that refers to what would you
    like to do with the normal drop down menu display.

    HTH

    "JT" wrote:

    > I have a macro where when I right click on a cell, I get a
    > form to display through a private sub. However, once the
    > form is closed, the "usual" menu (cut, copy, insert, etc.)
    > you get when you right click is displayed.
    >
    > Is there a way to disable the "usual" menu from appearing
    > on this worksheet only?
    >
    > Thanks for the help.
    >


  5. #5
    Bob Phillips
    Guest

    Re: disable right click menu

    oops. missed a bit

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.Name = "Sheet1" Then
    Application.CommandBars("Cell").Enabled = False
    Else
    Application.CommandBars("Cell").Enabled = True
    End If
    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Put this in the ThisWorkbook code module
    >
    > Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    > If Sh.Name = "Sheet1" Then
    > CommandBars("Cell").Enabled = False
    > Else
    > CommandBars("Cell").Enabled = True
    > End If
    > End Sub
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "JT" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a macro where when I right click on a cell, I get a
    > > form to display through a private sub. However, once the
    > > form is closed, the "usual" menu (cut, copy, insert, etc.)
    > > you get when you right click is displayed.
    > >
    > > Is there a way to disable the "usual" menu from appearing
    > > on this worksheet only?
    > >
    > > Thanks for the help.

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1