Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dev dev is offline
external usenet poster
 
Posts: 66
Default Right click event

How to capture "Clear Contents" Excel right click context menu option.

I want to run a piece of code when user right clicks on a cell and selects
"Clear Contents" context menu option.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Right click event

Dev,

Put the following code in the ThisWorkbook module.

Private WithEvents Ctrl As CommandBarButton

Private Sub Ctrl_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
MsgBox "Hello World"
End Sub

Private Sub Workbook_Open()
Set Ctrl = Application.CommandBars.FindControl(ID:=3125)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Dev" wrote in message
...
How to capture "Clear Contents" Excel right click context menu
option.

I want to run a piece of code when user right clicks on a cell
and selects
"Clear Contents" context menu option.



  #3   Report Post  
Posted to microsoft.public.excel.programming
dev dev is offline
external usenet poster
 
Posts: 66
Default Right click event

Thanks Chip - this worked great!!.

Do you know the ID for "Insert Copied Cells..."?

"Chip Pearson" wrote:

Dev,

Put the following code in the ThisWorkbook module.

Private WithEvents Ctrl As CommandBarButton

Private Sub Ctrl_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
MsgBox "Hello World"
End Sub

Private Sub Workbook_Open()
Set Ctrl = Application.CommandBars.FindControl(ID:=3125)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Dev" wrote in message
...
How to capture "Clear Contents" Excel right click context menu
option.

I want to run a piece of code when user right clicks on a cell
and selects
"Clear Contents" context menu option.




  #4   Report Post  
Posted to microsoft.public.excel.programming
dev dev is offline
external usenet poster
 
Posts: 66
Default Right click event

I think I got it... it's 3181

"Dev" wrote:

Thanks Chip - this worked great!!.

Do you know the ID for "Insert Copied Cells..."?

"Chip Pearson" wrote:

Dev,

Put the following code in the ThisWorkbook module.

Private WithEvents Ctrl As CommandBarButton

Private Sub Ctrl_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
MsgBox "Hello World"
End Sub

Private Sub Workbook_Open()
Set Ctrl = Application.CommandBars.FindControl(ID:=3125)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Dev" wrote in message
...
How to capture "Clear Contents" Excel right click context menu
option.

I want to run a piece of code when user right clicks on a cell
and selects
"Clear Contents" context menu option.




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
userform label double-click goes to click event John Paul Fullerton Excel Programming 3 May 19th 06 05:54 PM
On Click Event Craig Excel Programming 3 December 2nd 05 07:26 PM
Click event to run only once gavmer[_92_] Excel Programming 1 October 8th 04 07:23 AM
Click event to run only once gavmer[_85_] Excel Programming 0 October 5th 04 12:18 AM
Click event to run only once gavmer[_83_] Excel Programming 0 October 1st 04 01:24 AM


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

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

About Us

"It's about Microsoft Excel"