Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catching BeforeRightClick at Workbook not WorkSheet 1

Status
Not open for further replies.

snikde

Programmer
Mar 13, 2002
35
US
Okay, this is a tricky one I think. I have popup menu (right click) that fires when a user clicks in any cell of column 2. Here is the problem. I create new worksheets (Sheet.Add)in a very sophisticated macro, since the rightclick fires the event (Worksheet_BeforeRightClick)the ability to capture this in any of the newly added sheets is not available (no code at the worksheet level) How can I capture the event another level up the application chain (i.e. at the workbook level)? This would allow me to globally catch the user event regardless of which sheet is active at the time.
Remember, I create the sheets new and hence the sheet is void of code prior to the user getting the workbook. I use a template as part of this big macro and I could copy a blank sheet instead of adding a new empty one. Is there another way?


Guy
 


No problem. See the SheetBeforeRightClick event on the ThisWorkbook code page.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top