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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Watch MrExcel Video

Forum statistics

Threads
1,123,427
Messages
5,601,605
Members
414,462
Latest member
StageRiis

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