Worksheet_BeforeRightClick - run macro automatically when right click on cell and select "New Note"

KeepTrying

Active Member
Joined
Aug 19, 2012
Messages
272
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Dear Guys,

I have an older macro which ran well in earlier versions: when I right clicked on a cell and selected "Insert Comment": a macro ran automatically: of course I added following code to the appropriate sheet

VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Application.CommandBars("Cell").Controls("Insert Comment").OnAction = "MacroName_ToBeRun"
End Sub

As we know, right lick menu has changed from 2018 autumn in O365. So when I right click on a cell I need to select "New Note" (not "New Comment"!) instead of "Insert comment":

1580246378498.png


My problem, that code above doesn't work if I right click and choose "New Note" (I use O365 now) despite it worked in older versions (like in 2010).

Can anyone help?

Thank you.
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Watch MrExcel Video

Forum statistics

Threads
1,122,263
Messages
5,595,166
Members
413,973
Latest member
leon1974mk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top