Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable customize option when right click on menu bar areddy Excel Discussion (Misc queries) 0 October 20th 05 09:14 AM
disable right mouse click on "Worksheet Menu Bar" Max Potters Excel Programming 2 November 6th 04 02:45 PM
Disable Right click No Name Excel Programming 3 September 24th 04 03:27 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM
Adding menu to the mouse right click pop-up menu Jack Excel Programming 1 February 12th 04 05:23 AM


All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"